summaryrefslogtreecommitdiff
path: root/spec/features/profiles
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-03-16 20:18:57 -0700
committerStan Hu <stanhu@gmail.com>2017-03-16 20:18:57 -0700
commit7cad597f6c8ba794c6852e23d718ed7827da35c6 (patch)
treea81a2f320f35a546b5a6d7a1b54015877d53c0ff /spec/features/profiles
parent4bf4612cfbe73845391375bf721592426d7b4181 (diff)
downloadgitlab-ce-7cad597f6c8ba794c6852e23d718ed7827da35c6.tar.gz
Revert "Merge branch '8836-mr-revert' into 'master'
This reverts commit 68e40bd49fde7b790bb31b9ac85a249bedd817d2, reversing changes made to 2d1f823b4c8b60cee525384cb52e547d2be8925a.
Diffstat (limited to 'spec/features/profiles')
-rw-r--r--spec/features/profiles/user_changes_notified_of_own_activity_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/features/profiles/user_changes_notified_of_own_activity_spec.rb b/spec/features/profiles/user_changes_notified_of_own_activity_spec.rb
new file mode 100644
index 00000000000..e05fbb3715c
--- /dev/null
+++ b/spec/features/profiles/user_changes_notified_of_own_activity_spec.rb
@@ -0,0 +1,32 @@
+require 'spec_helper'
+
+feature 'Profile > Notifications > User changes notified_of_own_activity setting', feature: true, js: true do
+ let(:user) { create(:user) }
+
+ before do
+ login_as(user)
+ end
+
+ scenario 'User opts into receiving notifications about their own activity' do
+ visit profile_notifications_path
+
+ expect(page).not_to have_checked_field('user[notified_of_own_activity]')
+
+ check 'user[notified_of_own_activity]'
+
+ expect(page).to have_content('Notification settings saved')
+ expect(page).to have_checked_field('user[notified_of_own_activity]')
+ end
+
+ scenario 'User opts out of receiving notifications about their own activity' do
+ user.update!(notified_of_own_activity: true)
+ visit profile_notifications_path
+
+ expect(page).to have_checked_field('user[notified_of_own_activity]')
+
+ uncheck 'user[notified_of_own_activity]'
+
+ expect(page).to have_content('Notification settings saved')
+ expect(page).not_to have_checked_field('user[notified_of_own_activity]')
+ end
+end