Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-25 00:09:59 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-25 00:09:59 +0300
commit8a0ba602908b4360f52bf64fb715585d6245079e (patch)
tree0b9d005b11e26f2db40ce87d736abbb8fef7f755 /spec/views
parente9322e019bfeb7f33ce4c17662d93e6579303c2b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/profiles/notifications/show.html.haml_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/views/profiles/notifications/show.html.haml_spec.rb b/spec/views/profiles/notifications/show.html.haml_spec.rb
new file mode 100644
index 00000000000..9cdf8124fcf
--- /dev/null
+++ b/spec/views/profiles/notifications/show.html.haml_spec.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'profiles/notifications/show' do
+ let(:groups) { GroupsFinder.new(user).execute.page(1) }
+ let(:user) { create(:user) }
+
+ before do
+ assign(:group_notifications, [])
+ assign(:project_notifications, [])
+ assign(:user, user)
+ assign(:user_groups, groups)
+ allow(controller).to receive(:current_user).and_return(user)
+ allow(view).to receive(:experiment_enabled?)
+ end
+
+ context 'when there is no database value for User#notification_email' do
+ let(:option_default) { _('Use primary email (%{email})') % { email: user.email } }
+ let(:option_primary_email) { user.email }
+ let(:options) { [option_default, option_primary_email] }
+
+ it 'displays the correct elements' do
+ render
+
+ expect(rendered).to have_select('user_notification_email', options: options, selected: nil)
+ end
+ end
+end