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:
authorRichard Macklin <richard.github@nrm.com>2017-01-27 12:32:00 +0300
committerRichard Macklin <richard.github@nrm.com>2017-02-01 22:31:22 +0300
commit530d0fda7b97a9a3d8836a36b02e50bc5d408464 (patch)
treeb9bc6d51266315e7847ac7c1c0271f9b8e65a01c /spec/features/profiles
parent3e81bc7b1daec9dfda602165d7e36cf5b6a39e20 (diff)
Add checkbox in UI to opt into receiving notifications about your activity
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..0709f32bf0c
--- /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]')
+
+ page.find('#user_notified_of_own_activity').set(true)
+
+ 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]')
+
+ page.find('#user_notified_of_own_activity').set(false)
+
+ expect(page).to have_content('Notification settings saved')
+ expect(page).not_to have_checked_field('user[notified_of_own_activity]')
+ end
+end