summaryrefslogtreecommitdiffstats
path: root/test/integration/api_test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-02 19:49:51 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-02 19:49:51 +0000
commit395fe0d777f2f41c1594ae95f1199ae8de25c184 (patch)
treee69b11c77805a5829a24bd7c7fec01b4619852d0 /test/integration/api_test
parent606ca39d101c559e1add4de23447c6c9132e0be6 (diff)
downloadredmine-395fe0d777f2f41c1594ae95f1199ae8de25c184.tar.gz
redmine-395fe0d777f2f41c1594ae95f1199ae8de25c184.zip
Test cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8476 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/api_test')
-rw-r--r--test/integration/api_test/disabled_rest_api_test.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/test/integration/api_test/disabled_rest_api_test.rb b/test/integration/api_test/disabled_rest_api_test.rb
index 798b7973c..22029b9a4 100644
--- a/test/integration/api_test/disabled_rest_api_test.rb
+++ b/test/integration/api_test/disabled_rest_api_test.rb
@@ -41,8 +41,7 @@ class ApiTest::DisabledRestApiTest < ActionController::IntegrationTest
context "with a valid HTTP authentication" do
setup do
@user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
- get "/news.xml", nil, :authorization => @authorization
+ get "/news.xml", nil, :authorization => credentials(@user.login, 'my_password')
end
should_respond_with :unauthorized
@@ -56,8 +55,7 @@ class ApiTest::DisabledRestApiTest < ActionController::IntegrationTest
setup do
@user = User.generate_with_protected!
@token = Token.generate!(:user => @user, :action => 'api')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'X')
- get "/news.xml", nil, :authorization => @authorization
+ get "/news.xml", nil, :authorization => credentials(@token.value, 'X')
end
should_respond_with :unauthorized
@@ -86,8 +84,7 @@ class ApiTest::DisabledRestApiTest < ActionController::IntegrationTest
context "with a valid HTTP authentication" do
setup do
@user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
- get "/news.json", nil, :authorization => @authorization
+ get "/news.json", nil, :authorization => credentials(@user.login, 'my_password')
end
should_respond_with :unauthorized
@@ -101,8 +98,7 @@ class ApiTest::DisabledRestApiTest < ActionController::IntegrationTest
setup do
@user = User.generate_with_protected!
@token = Token.generate!(:user => @user, :action => 'api')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'DoesNotMatter')
- get "/news.json", nil, :authorization => @authorization
+ get "/news.json", nil, :authorization => credentials(@token.value, 'DoesNotMatter')
end
should_respond_with :unauthorized