summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelogs/unreleased/replace_spinach_spec_profile_notifications-feature.yml4
-rw-r--r--features/profile/notifications.feature15
-rw-r--r--spec/features/profiles/user_visits_notifications_tab_spec.rb21
3 files changed, 25 insertions, 15 deletions
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