From: Eric Davis Date: Mon, 2 Aug 2010 15:42:54 +0000 (+0000) Subject: Added tests for AccountController#register GET. X-Git-Tag: 1.1.0~489 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5c525f0b41abc11c49b91ad5885302387d531f75;p=redmine.git Added tests for AccountController#register GET. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3903 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb index 17d19dfe1..ce3d13f10 100644 --- a/test/functional/account_controller_test.rb +++ b/test/functional/account_controller_test.rb @@ -153,4 +153,27 @@ class AccountControllerTest < ActionController::TestCase assert_redirected_to '' assert_nil @request.session[:user_id] end + + context "GET #register" do + context "with self registration on" do + setup do + Setting.self_registration = '3' + get :register + end + + should_respond_with :success + should_render_template :register + should_assign_to :user + end + + context "with self registration off" do + setup do + Setting.self_registration = '0' + get :register + end + + should_redirect_to('/') { home_url } + end + end + end