summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-01-13 04:52:28 +0000
committerRémy Coutable <remy@rymai.me>2017-01-13 04:52:28 +0000
commitf20d3cb3faa31c70be0f4d7b6e1428d142b8a48f (patch)
tree0ea9c51dd76d0c7a77d00cba0eed29750d117f12
parentf2499fd430b1cd48b2d7956f63536e525a3b32a8 (diff)
parent9af81a5a0a366e04319db2d181d555c171db5b22 (diff)
downloadgitlab-ce-f20d3cb3faa31c70be0f4d7b6e1428d142b8a48f.tar.gz
Merge branch 'move-dashboard-activetab-spinach-to-rspec' into 'master'
Move dashboard active tab spinach test to rspec See merge request !8423
-rw-r--r--features/dashboard/active_tab.feature24
-rw-r--r--features/steps/dashboard/active_tab.rb5
-rw-r--r--spec/features/dashboard/active_tab_spec.rb46
3 files changed, 46 insertions, 29 deletions
diff --git a/features/dashboard/active_tab.feature b/features/dashboard/active_tab.feature
deleted file mode 100644
index bd883a0ebfa..00000000000
--- a/features/dashboard/active_tab.feature
+++ /dev/null
@@ -1,24 +0,0 @@
-@dashboard
-Feature: Dashboard Active Tab
- Background:
- Given I sign in as a user
-
- Scenario: On Dashboard Home
- Given I visit dashboard page
- Then the active main tab should be Home
- And no other main tabs should be active
-
- Scenario: On Dashboard Issues
- Given I visit dashboard issues page
- Then the active main tab should be Issues
- And no other main tabs should be active
-
- Scenario: On Dashboard Merge Requests
- Given I visit dashboard merge requests page
- Then the active main tab should be Merge Requests
- And no other main tabs should be active
-
- Scenario: On Dashboard Groups
- Given I visit dashboard groups page
- Then the active main tab should be Groups
- And no other main tabs should be active
diff --git a/features/steps/dashboard/active_tab.rb b/features/steps/dashboard/active_tab.rb
deleted file mode 100644
index 04fe96cef22..00000000000
--- a/features/steps/dashboard/active_tab.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-class Spinach::Features::DashboardActiveTab < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedPaths
- include SharedSidebarActiveTab
-end
diff --git a/spec/features/dashboard/active_tab_spec.rb b/spec/features/dashboard/active_tab_spec.rb
new file mode 100644
index 00000000000..7d59fcac517
--- /dev/null
+++ b/spec/features/dashboard/active_tab_spec.rb
@@ -0,0 +1,46 @@
+require 'spec_helper'
+
+RSpec.describe 'Dashboard Active Tab', feature: true do
+ before do
+ login_as :user
+ end
+
+ shared_examples 'page has active tab' do |title|
+ it "#{title} tab" do
+ expect(page).to have_selector('.nav-sidebar li.active', count: 1)
+ expect(find('.nav-sidebar li.active')).to have_content(title)
+ end
+ end
+
+ context 'on dashboard projects' do
+ before do
+ visit dashboard_projects_path
+ end
+
+ it_behaves_like 'page has active tab', 'Projects'
+ end
+
+ context 'on dashboard issues' do
+ before do
+ visit issues_dashboard_path
+ end
+
+ it_behaves_like 'page has active tab', 'Issues'
+ end
+
+ context 'on dashboard merge requests' do
+ before do
+ visit merge_requests_dashboard_path
+ end
+
+ it_behaves_like 'page has active tab', 'Merge Requests'
+ end
+
+ context 'on dashboard groups' do
+ before do
+ visit dashboard_groups_path
+ end
+
+ it_behaves_like 'page has active tab', 'Groups'
+ end
+end