Added tests for the other OpenID authentication cases. #699

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2445 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis
2009-02-11 19:07:23 +00:00
parent 48e26aa75b
commit 876fb69271
3 changed files with 19 additions and 7 deletions
+15 -3
View File
@@ -70,12 +70,24 @@ class AccountControllerTest < Test::Unit::TestCase
end
def test_login_with_openid_with_new_user_created
post :login, :openid_url => 'http://openid.example.com/good_user'
assert_redirected_to 'my/page'
user = User.find_by_login('cool_user')
assert user
assert_equal 'Cool', user.firstname
assert_equal 'User', user.lastname
end
def test_login_with_openid_with_new_user_with_conflict
def test_login_with_openid_with_new_user_with_conflict_should_register
existing_user = User.new(:firstname => 'Cool', :lastname => 'User', :mail => 'user@somedomain.com')
existing_user.login = 'cool_user'
assert existing_user.save!
post :login, :openid_url => 'http://openid.example.com/good_user'
assert_response :success
assert_template 'register'
assert assigns(:user)
assert_equal 'http://openid.example.com/good_user', assigns(:user)[:identity_url]
end
def test_autologin