diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
commit | 9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch) | |
tree | 70467ae3692a0e35e5ea56bcb803eb512a10bedb /spec/controllers/registrations | |
parent | 4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff) |
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
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 |