diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-03-14 17:14:05 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-03-14 17:17:20 +0100 |
commit | 07eb31eeacc4e0364b839233a41fa65eb3c650ce (patch) | |
tree | 843cda5a4d9bc730aba9a13d0634fef5e2212515 /spec/controllers/auth/registrations_controller_spec.rb | |
parent | fa75324059c7a146354470691888dc0e1de0342f (diff) | |
parent | 874bd3ac0c56e2d2901785e170b27f5cde32b33b (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - app/views/admin/settings/edit.html.haml: Conflict due to how the theming settings change.
Diffstat (limited to 'spec/controllers/auth/registrations_controller_spec.rb')
-rw-r--r-- | spec/controllers/auth/registrations_controller_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/controllers/auth/registrations_controller_spec.rb b/spec/controllers/auth/registrations_controller_spec.rb index eeb01d5ad..1095df034 100644 --- a/spec/controllers/auth/registrations_controller_spec.rb +++ b/spec/controllers/auth/registrations_controller_spec.rb @@ -5,14 +5,14 @@ RSpec.describe Auth::RegistrationsController, type: :controller do shared_examples 'checks for enabled registrations' do |path| around do |example| - open_registrations = Setting.open_registrations + registrations_mode = Setting.registrations_mode example.run - Setting.open_registrations = open_registrations + Setting.registrations_mode = registrations_mode end it 'redirects if it is in single user mode while it is open for registration' do Fabricate(:account) - Setting.open_registrations = true + Setting.registrations_mode = 'open' expect(Rails.configuration.x).to receive(:single_user_mode).and_return(true) get path @@ -21,7 +21,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do end it 'redirects if it is not open for registration while it is not in single user mode' do - Setting.open_registrations = false + Setting.registrations_mode = 'none' expect(Rails.configuration.x).to receive(:single_user_mode).and_return(false) get path @@ -55,13 +55,13 @@ RSpec.describe Auth::RegistrationsController, type: :controller do context do around do |example| - open_registrations = Setting.open_registrations + registrations_mode = Setting.registrations_mode example.run - Setting.open_registrations = open_registrations + Setting.registrations_mode = registrations_mode end it 'returns http success' do - Setting.open_registrations = true + Setting.registrations_mode = 'open' get :new expect(response).to have_http_status(200) end @@ -83,13 +83,13 @@ RSpec.describe Auth::RegistrationsController, type: :controller do context do around do |example| - open_registrations = Setting.open_registrations + registrations_mode = Setting.registrations_mode example.run - Setting.open_registrations = open_registrations + Setting.registrations_mode = registrations_mode end subject do - Setting.open_registrations = true + Setting.registrations_mode = 'open' request.headers["Accept-Language"] = accept_language post :create, params: { user: { account_attributes: { username: 'test' }, email: 'test@example.com', password: '12345678', password_confirmation: '12345678' } } end |