summaryrefslogtreecommitdiff
path: root/spec/controllers
diff options
context:
space:
mode:
authorGeorge Andrinopoulos <geoandri@gmail.com>2017-03-27 09:37:24 +0000
committerRémy Coutable <remy@rymai.me>2017-03-27 09:37:24 +0000
commit7c74a0209b2354ee9260bfebe9bbde5cd0c141bf (patch)
treef98ebab7adf9ca90ab7128c4f9e9605d84b13ae9 /spec/controllers
parente19d4c511d21e14d2442546a5d00c5fbdf13308a (diff)
downloadgitlab-ce-7c74a0209b2354ee9260bfebe9bbde5cd0c141bf.tar.gz
Implement new service for creating user
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/registrations_controller_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb
index 8cc216445eb..902911071c4 100644
--- a/spec/controllers/registrations_controller_spec.rb
+++ b/spec/controllers/registrations_controller_spec.rb
@@ -30,6 +30,15 @@ describe RegistrationsController do
expect(subject.current_user).to be_nil
end
end
+
+ context 'when signup_enabled? is false' do
+ it 'redirects to sign_in' do
+ allow_any_instance_of(ApplicationSetting).to receive(:signup_enabled?).and_return(false)
+
+ expect { post(:create, user_params) }.not_to change(User, :count)
+ expect(response).to redirect_to(new_user_session_path)
+ end
+ end
end
context 'when reCAPTCHA is enabled' do