Commit cc2145da authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fixed sub navs spinach tests for project

parent 1811d32e
...@@ -52,48 +52,34 @@ Feature: Project active tab ...@@ -52,48 +52,34 @@ Feature: Project active tab
Then the active main tab should be Home Then the active main tab should be Home
And no other main tabs should be active And no other main tabs should be active
#Scenario: On Project Settings/Attachments
#Given I visit my project's home page
#And I click the "Attachments" tab
#Then the active sub tab should be Attachments
#And no other sub tabs should be active
#And the active main tab should be Home
#Scenario: On Project Settings/Snippets
#Given I visit my project's home page
#And I click the "Snippets" tab
#Then the active sub tab should be Snippets
#And no other sub tabs should be active
#And the active main tab should be Home
# Sub Tabs: Settings # Sub Tabs: Settings
Scenario: On Project Settings/Team Scenario: On Project Settings/Team
Given I visit my project's settings page Given I visit my project's settings page
And I click the "Team" tab And I click the "Team" tab
Then the active sub tab should be Team Then the active sub nav should be Team
And no other sub tabs should be active And no other sub navs should be active
And the active main tab should be Settings And the active main tab should be Settings
Scenario: On Project Settings/Edit Scenario: On Project Settings/Edit
Given I visit my project's settings page Given I visit my project's settings page
And I click the "Edit" tab And I click the "Edit" tab
Then the active sub tab should be Edit Then the active sub nav should be Edit
And no other sub tabs should be active And no other sub navs should be active
And the active main tab should be Settings And the active main tab should be Settings
Scenario: On Project Settings/Hooks Scenario: On Project Settings/Hooks
Given I visit my project's settings page Given I visit my project's settings page
And I click the "Hooks" tab And I click the "Hooks" tab
Then the active sub tab should be Hooks Then the active sub nav should be Hooks
And no other sub tabs should be active And no other sub navs should be active
And the active main tab should be Settings And the active main tab should be Settings
Scenario: On Project Settings/Deploy Keys Scenario: On Project Settings/Deploy Keys
Given I visit my project's settings page Given I visit my project's settings page
And I click the "Deploy Keys" tab And I click the "Deploy Keys" tab
Then the active sub tab should be Deploy Keys Then the active sub nav should be Deploy Keys
And no other sub tabs should be active And no other sub navs should be active
And the active main tab should be Settings And the active main tab should be Settings
# Sub Tabs: Commits # Sub Tabs: Commits
......
...@@ -68,32 +68,20 @@ class ProjectActiveTab < Spinach::FeatureSteps ...@@ -68,32 +68,20 @@ class ProjectActiveTab < Spinach::FeatureSteps
click_link('Deploy Keys') click_link('Deploy Keys')
end end
Then 'the active sub tab should be Show' do Then 'the active sub nav should be Team' do
ensure_active_sub_tab('Show') ensure_active_sub_nav('Members')
end end
Then 'the active sub tab should be Team' do Then 'the active sub nav should be Edit' do
ensure_active_sub_tab('Members') ensure_active_sub_nav('Edit Project')
end end
Then 'the active sub tab should be Attachments' do Then 'the active sub nav should be Hooks' do
ensure_active_sub_tab('Attachments') ensure_active_sub_nav('Web Hooks')
end end
Then 'the active sub tab should be Snippets' do Then 'the active sub nav should be Deploy Keys' do
ensure_active_sub_tab('Snippets') ensure_active_sub_nav('Deploy Keys')
end
Then 'the active sub tab should be Edit' do
ensure_active_sub_tab('Edit')
end
Then 'the active sub tab should be Hooks' do
ensure_active_sub_tab('Web Hooks')
end
Then 'the active sub tab should be Deploy Keys' do
ensure_active_sub_tab('Deploy Keys')
end end
# Sub Tabs: Commits # Sub Tabs: Commits
......
...@@ -13,6 +13,10 @@ module SharedActiveTab ...@@ -13,6 +13,10 @@ module SharedActiveTab
page.find('div.content ul.nav-tabs li.active').should have_content(content) page.find('div.content ul.nav-tabs li.active').should have_content(content)
end end
def ensure_active_sub_nav(content)
page.find('div.content ul.nav-stacked-menu li.active').should have_content(content)
end
And 'no other main tabs should be active' do And 'no other main tabs should be active' do
page.should have_selector('.main-nav li.active', count: 1) page.should have_selector('.main-nav li.active', count: 1)
end end
...@@ -20,4 +24,8 @@ module SharedActiveTab ...@@ -20,4 +24,8 @@ module SharedActiveTab
And 'no other sub tabs should be active' do And 'no other sub tabs should be active' do
page.should have_selector('div.content ul.nav-tabs li.active', count: 1) page.should have_selector('div.content ul.nav-tabs li.active', count: 1)
end end
And 'no other sub navs should be active' do
page.should have_selector('div.content ul.nav-stacked-menu li.active', count: 1)
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment