summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2009-02-11 19:07:41 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2009-02-11 19:07:41 +0000
commit85ad791d815ce197b381b42fcd1503ecef0d34f5 (patch)
tree5ff9170e9c133e21bb0965fb674f743c69b1e0a1 /test
parent720f928cd2cafd0edb4357bce9d63e3b4dd10c3b (diff)
downloadredmine-85ad791d815ce197b381b42fcd1503ecef0d34f5.tar.gz
redmine-85ad791d815ce197b381b42fcd1503ecef0d34f5.zip
Prevent registration via OpenID if self registration is off. #699
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2448 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/account_controller_test.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb
index edca1d2f1..aec626a2f 100644
--- a/test/functional/account_controller_test.rb
+++ b/test/functional/account_controller_test.rb
@@ -86,7 +86,15 @@ class AccountControllerTest < Test::Unit::TestCase
assert_equal 'Cool', user.firstname
assert_equal 'User', user.lastname
end
-
+
+ def test_login_with_openid_with_new_user_and_self_registration_off
+ Setting.self_registration = '0'
+ post :login, :openid_url => 'http://openid.example.com/good_user'
+ assert_redirected_to home_url
+ user = User.find_by_login('cool_user')
+ assert ! user
+ end
+
def test_login_with_openid_with_new_user_created_with_email_activation_should_have_a_token
Setting.self_registration = '1'
post :login, :openid_url => 'http://openid.example.com/good_user'