Added tests for AccountController#register GET.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3903 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis 2010-08-02 15:42:54 +00:00
parent ca663fcd10
commit 5c525f0b41
1 changed files with 23 additions and 0 deletions

View File

@ -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