diff options
author | Rémy Coutable <remy@rymai.me> | 2017-01-31 11:05:50 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-01-31 11:05:50 +0100 |
commit | 8615138706337e6aca75d635e8fe3a867f9e69bd (patch) | |
tree | eb97e01d4fd0cb2368c70d9d249adde7a00694e2 | |
parent | c9203e25d214487b2b7ccc0e85af32e418a84bcb (diff) | |
download | gitlab-ce-move-dashboard-shortcuts-from-spinach-to-rspec.tar.gz |
Move Dashboard shortcuts specs from Spinah to RSpecmove-dashboard-shortcuts-from-spinach-to-rspec
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r-- | features/dashboard/shortcuts.feature | 21 | ||||
-rw-r--r-- | features/steps/dashboard/shortcuts.rb | 7 | ||||
-rw-r--r-- | spec/features/dashboard/shortcuts_spec.rb | 29 |
3 files changed, 29 insertions, 28 deletions
diff --git a/features/dashboard/shortcuts.feature b/features/dashboard/shortcuts.feature deleted file mode 100644 index 41d79aa6ec8..00000000000 --- a/features/dashboard/shortcuts.feature +++ /dev/null @@ -1,21 +0,0 @@ -@dashboard -Feature: Dashboard Shortcuts - Background: - Given I sign in as a user - And I visit dashboard page - - @javascript - Scenario: Navigate to projects tab - Given I press "g" and "p" - Then the active main tab should be Projects - - @javascript - Scenario: Navigate to issue tab - Given I press "g" and "i" - Then the active main tab should be Issues - - @javascript - Scenario: Navigate to merge requests tab - Given I press "g" and "m" - Then the active main tab should be Merge Requests - diff --git a/features/steps/dashboard/shortcuts.rb b/features/steps/dashboard/shortcuts.rb deleted file mode 100644 index 118d27888df..00000000000 --- a/features/steps/dashboard/shortcuts.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Spinach::Features::DashboardShortcuts < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - include SharedSidebarActiveTab - include SharedShortcuts -end diff --git a/spec/features/dashboard/shortcuts_spec.rb b/spec/features/dashboard/shortcuts_spec.rb new file mode 100644 index 00000000000..d9be4e5dbdd --- /dev/null +++ b/spec/features/dashboard/shortcuts_spec.rb @@ -0,0 +1,29 @@ +require 'spec_helper' + +feature 'Dashboard shortcuts', feature: true, js: true do + before do + login_as :user + visit dashboard_projects_path + end + + scenario 'Navigate to tabs' do + find('body').native.send_key('g') + find('body').native.send_key('p') + + ensure_active_main_tab('Projects') + + find('body').native.send_key('g') + find('body').native.send_key('i') + + ensure_active_main_tab('Issues') + + find('body').native.send_key('g') + find('body').native.send_key('m') + + ensure_active_main_tab('Merge Requests') + end + + def ensure_active_main_tab(content) + expect(find('.nav-sidebar li.active')).to have_content(content) + end +end |