summaryrefslogtreecommitdiffstats
path: root/test/test_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-02 19:59:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-02 19:59:52 +0000
commit131f258f5fba320a779bdd69e3681beab07fb8e3 (patch)
tree70f0804372dbab34476c5acb2c30c87fee61560e /test/test_helper.rb
parent395fe0d777f2f41c1594ae95f1199ae8de25c184 (diff)
downloadredmine-131f258f5fba320a779bdd69e3681beab07fb8e3.tar.gz
redmine-131f258f5fba320a779bdd69e3681beab07fb8e3.zip
Test cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8477 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r--test/test_helper.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 16afd6a79..bf6d5b366 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -63,7 +63,7 @@ class ActiveSupport::TestCase
end
def credentials(user, password=nil)
- ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)
+ {:authorization => ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)}
end
# Mock out a file
@@ -244,7 +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
- send(http_method, url, parameters, {:authorization => credentials(@user.login, 'my_password')})
+ send(http_method, url, parameters, credentials(@user.login, 'my_password'))
end
should_respond_with success_code
@@ -257,7 +257,7 @@ class ActiveSupport::TestCase
context "with an invalid HTTP authentication" do
setup do
@user = User.generate_with_protected!
- send(http_method, url, parameters, {:authorization => credentials(@user.login, 'wrong_password')})
+ send(http_method, url, parameters, credentials(@user.login, 'wrong_password'))
end
should_respond_with failure_code
@@ -269,7 +269,7 @@ class ActiveSupport::TestCase
context "without credentials" do
setup do
- send(http_method, url, parameters, {:authorization => ''})
+ send(http_method, url, parameters)
end
should_respond_with failure_code
@@ -299,7 +299,7 @@ class ActiveSupport::TestCase
setup do
@user = User.generate_with_protected!(:admin => true)
@token = Token.generate!(:user => @user, :action => 'api')
- send(http_method, url, parameters, {:authorization => credentials(@token.value, 'X')})
+ send(http_method, url, parameters, credentials(@token.value, 'X'))
end
should_respond_with success_code
@@ -314,7 +314,7 @@ class ActiveSupport::TestCase
setup do
@user = User.generate_with_protected!
@token = Token.generate!(:user => @user, :action => 'feeds')
- send(http_method, url, parameters, {:authorization => credentials(@token.value, 'X')})
+ send(http_method, url, parameters, credentials(@token.value, 'X'))
end
should_respond_with failure_code