@@ -153,4 +153,27 class AccountControllerTest < ActionController::TestCase | |||||
153 | assert_redirected_to '' |
|
153 | assert_redirected_to '' | |
154 | assert_nil @request.session[:user_id] |
|
154 | assert_nil @request.session[:user_id] | |
155 | end |
|
155 | end | |
|
156 | ||||
|
157 | context "GET #register" do | |||
|
158 | context "with self registration on" do | |||
|
159 | setup do | |||
|
160 | Setting.self_registration = '3' | |||
|
161 | get :register | |||
|
162 | end | |||
|
163 | ||||
|
164 | should_respond_with :success | |||
|
165 | should_render_template :register | |||
|
166 | should_assign_to :user | |||
|
167 | end | |||
|
168 | ||||
|
169 | context "with self registration off" do | |||
|
170 | setup do | |||
|
171 | Setting.self_registration = '0' | |||
|
172 | get :register | |||
|
173 | end | |||
|
174 | ||||
|
175 | should_redirect_to('/') { home_url } | |||
|
176 | end | |||
|
177 | end | |||
|
178 | ||||
156 | end |
|
179 | end |
General Comments 0
You need to be logged in to leave comments.
Login now