diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-07 21:09:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-07 21:09:45 +0300 |
commit | 413119517cca6a47f52d77b49ae3cab4cdaf9884 (patch) | |
tree | 046eb80cb92bb948cd49a99b7c34bf8dc6884c4f /spec/controllers/registrations | |
parent | 40b78ea2b6f5f0ef730c2cd811911be3449562e6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/registrations')
-rw-r--r-- | spec/controllers/registrations/welcome_controller_spec.rb | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/controllers/registrations/welcome_controller_spec.rb b/spec/controllers/registrations/welcome_controller_spec.rb index d32c936b8c9..008259a8bfa 100644 --- a/spec/controllers/registrations/welcome_controller_spec.rb +++ b/spec/controllers/registrations/welcome_controller_spec.rb @@ -60,8 +60,10 @@ RSpec.describe Registrations::WelcomeController do end describe '#update' do + let(:email_opted_in) { '0' } + subject(:update) do - patch :update, params: { user: { role: 'software_developer', setup_for_company: 'false' } } + patch :update, params: { user: { role: 'software_developer', setup_for_company: 'false', email_opted_in: email_opted_in } } end context 'without a signed in user' do @@ -74,6 +76,24 @@ RSpec.describe Registrations::WelcomeController do end it { is_expected.to redirect_to(dashboard_projects_path)} + + context 'when the user opted in' do + let(:email_opted_in) { '1' } + + it 'sets the email_opted_in field' do + subject + + expect(controller.current_user.email_opted_in).to eq(true) + end + end + + context 'when the user opted out' do + it 'sets the email_opted_in field' do + subject + + expect(controller.current_user.email_opted_in).to eq(false) + end + end end end end |