From ece7a3cfdcb0923831bc9ebd7aaf52a9763c1613 Mon Sep 17 00:00:00 2001 From: blackst0ne Date: Thu, 22 Jun 2017 13:28:11 +1100 Subject: Replace 'profile/notifications.feature' spinach test with an rspec analog --- ...e_spinach_spec_profile_notifications-feature.yml | 4 ++++ features/profile/notifications.feature | 15 --------------- .../profiles/user_visits_notifications_tab_spec.rb | 21 +++++++++++++++++++++ 3 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 changelogs/unreleased/replace_spinach_spec_profile_notifications-feature.yml delete mode 100644 features/profile/notifications.feature create mode 100644 spec/features/profiles/user_visits_notifications_tab_spec.rb diff --git a/changelogs/unreleased/replace_spinach_spec_profile_notifications-feature.yml b/changelogs/unreleased/replace_spinach_spec_profile_notifications-feature.yml new file mode 100644 index 00000000000..38227ebfa7a --- /dev/null +++ b/changelogs/unreleased/replace_spinach_spec_profile_notifications-feature.yml @@ -0,0 +1,4 @@ +--- +title: Replace 'profile/notifications.feature' spinach test with an rspec analog +merge_request: 12345 +author: @blackst0ne diff --git a/features/profile/notifications.feature b/features/profile/notifications.feature deleted file mode 100644 index ef8743932f5..00000000000 --- a/features/profile/notifications.feature +++ /dev/null @@ -1,15 +0,0 @@ -@profile -Feature: Profile Notifications - Background: - Given I sign in as a user - And I own project "Shop" - - Scenario: I visit notifications tab - When I visit profile notifications page - Then I should see global notifications settings - - @javascript - Scenario: I edit Project Notifications - Given I visit profile notifications page - When I select Mention setting from dropdown - Then I should see Notification saved message diff --git a/spec/features/profiles/user_visits_notifications_tab_spec.rb b/spec/features/profiles/user_visits_notifications_tab_spec.rb new file mode 100644 index 00000000000..e98cec79d87 --- /dev/null +++ b/spec/features/profiles/user_visits_notifications_tab_spec.rb @@ -0,0 +1,21 @@ +require 'spec_helper' + +feature 'User visits the notifications tab', js: true do + let(:project) { create(:empty_project) } + let(:user) { create(:user) } + + before do + project.team << [user, :master] + sign_in(user) + visit(profile_notifications_path) + end + + it 'changes the project notifications setting' do + expect(page).to have_content('Notifications') + + first('#notifications-button').trigger('click') + click_link('On mention') + + expect(page).to have_content('On mention') + end +end -- cgit v1.2.3