diff options
author | Robert Speicher <robert@gitlab.com> | 2017-03-27 15:55:47 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-03-27 15:55:47 +0000 |
commit | aeff506a4ea247bd912de967e43dd34dd5fad453 (patch) | |
tree | 15b7747d3cc8ce1a9788a43c39252feb97738796 /spec/features/profiles/user_changes_notified_of_own_activity_spec.rb | |
parent | 8bddf23e60459703b60d1c034ca155d5cd0e7536 (diff) | |
parent | c8ad3346b0d5575faab49f247192f58c92e1ce72 (diff) | |
download | gitlab-ce-aeff506a4ea247bd912de967e43dd34dd5fad453.tar.gz |
Merge branch 'sh-bring-back-option-to-be-notified-of-own-activity' into 'master'
Bring back option to be notified of own activity
See merge request !10032
Diffstat (limited to 'spec/features/profiles/user_changes_notified_of_own_activity_spec.rb')
-rw-r--r-- | spec/features/profiles/user_changes_notified_of_own_activity_spec.rb | 32 |
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 |