Test cleanup.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8476 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-01-02 19:49:51 +00:00
parent 606ca39d10
commit 395fe0d777
2 changed files with 8 additions and 16 deletions
@@ -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