Mercurial > hg > soundsoftware-site
annotate test/integration/api_test/http_basic_login_test.rb @ 119:8661b858af72
* Update to Redmine trunk rev 4705
author | Chris Cannam |
---|---|
date | Thu, 13 Jan 2011 14:12:06 +0000 |
parents | 94944d00e43c |
children | cbb26bc654de |
rev | line source |
---|---|
Chris@119 | 1 require File.expand_path('../../../test_helper', __FILE__) |
chris@37 | 2 |
chris@37 | 3 class ApiTest::HttpBasicLoginTest < ActionController::IntegrationTest |
chris@37 | 4 fixtures :all |
chris@37 | 5 |
chris@37 | 6 def setup |
chris@37 | 7 Setting.rest_api_enabled = '1' |
chris@37 | 8 Setting.login_required = '1' |
chris@37 | 9 end |
chris@37 | 10 |
chris@37 | 11 def teardown |
chris@37 | 12 Setting.rest_api_enabled = '0' |
chris@37 | 13 Setting.login_required = '0' |
chris@37 | 14 end |
chris@37 | 15 |
chris@37 | 16 # Using the NewsController because it's a simple API. |
chris@37 | 17 context "get /news" do |
chris@37 | 18 setup do |
chris@37 | 19 project = Project.find('onlinestore') |
chris@37 | 20 EnabledModule.create(:project => project, :name => 'news') |
chris@37 | 21 end |
chris@37 | 22 |
chris@37 | 23 context "in :xml format" do |
chris@37 | 24 should_allow_http_basic_auth_with_username_and_password(:get, "/projects/onlinestore/news.xml") |
chris@37 | 25 end |
chris@37 | 26 |
chris@37 | 27 context "in :json format" do |
chris@37 | 28 should_allow_http_basic_auth_with_username_and_password(:get, "/projects/onlinestore/news.json") |
chris@37 | 29 end |
chris@37 | 30 end |
chris@37 | 31 end |