summaryrefslogtreecommitdiffstats
path: root/test/test_helper.rb
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/test_helper.rb
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/test_helper.rb')
-rw-r--r--test/test_helper.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index c0947efc3..16afd6a79 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -244,8 +244,7 @@ class ActiveSupport::TestCase
context "with a valid HTTP authentication" do
setup do
@user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password', :admin => true) # Admin so they can access the project
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
- send(http_method, url, parameters, {:authorization => @authorization})
+ send(http_method, url, parameters, {:authorization => credentials(@user.login, 'my_password')})
end
should_respond_with success_code
@@ -258,8 +257,7 @@ class ActiveSupport::TestCase
context "with an invalid HTTP authentication" do
setup do
@user = User.generate_with_protected!
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'wrong_password')
- send(http_method, url, parameters, {:authorization => @authorization})
+ send(http_method, url, parameters, {:authorization => credentials(@user.login, 'wrong_password')})
end
should_respond_with failure_code
@@ -301,8 +299,7 @@ class ActiveSupport::TestCase
setup do
@user = User.generate_with_protected!(:admin => true)
@token = Token.generate!(:user => @user, :action => 'api')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'X')
- send(http_method, url, parameters, {:authorization => @authorization})
+ send(http_method, url, parameters, {:authorization => credentials(@token.value, 'X')})
end
should_respond_with success_code
@@ -317,8 +314,7 @@ class ActiveSupport::TestCase
setup do
@user = User.generate_with_protected!
@token = Token.generate!(:user => @user, :action => 'feeds')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'X')
- send(http_method, url, parameters, {:authorization => @authorization})
+ send(http_method, url, parameters, {:authorization => credentials(@token.value, 'X')})
end
should_respond_with failure_code