Commit cc2145da80abe53052598b062d7853efdf225d8b

Authored by Dmitriy Zaporozhets
1 parent 1811d32e

Fixed sub navs spinach tests for project

features/project/active_tab.feature
@@ -52,48 +52,34 @@ Feature: Project active tab @@ -52,48 +52,34 @@ Feature: Project active tab
52 Then the active main tab should be Home 52 Then the active main tab should be Home
53 And no other main tabs should be active 53 And no other main tabs should be active
54 54
55 - #Scenario: On Project Settings/Attachments  
56 - #Given I visit my project's home page  
57 - #And I click the "Attachments" tab  
58 - #Then the active sub tab should be Attachments  
59 - #And no other sub tabs should be active  
60 - #And the active main tab should be Home  
61 -  
62 - #Scenario: On Project Settings/Snippets  
63 - #Given I visit my project's home page  
64 - #And I click the "Snippets" tab  
65 - #Then the active sub tab should be Snippets  
66 - #And no other sub tabs should be active  
67 - #And the active main tab should be Home  
68 -  
69 # Sub Tabs: Settings 55 # Sub Tabs: Settings
70 56
71 Scenario: On Project Settings/Team 57 Scenario: On Project Settings/Team
72 Given I visit my project's settings page 58 Given I visit my project's settings page
73 And I click the "Team" tab 59 And I click the "Team" tab
74 - Then the active sub tab should be Team  
75 - And no other sub tabs should be active 60 + Then the active sub nav should be Team
  61 + And no other sub navs should be active
76 And the active main tab should be Settings 62 And the active main tab should be Settings
77 63
78 Scenario: On Project Settings/Edit 64 Scenario: On Project Settings/Edit
79 Given I visit my project's settings page 65 Given I visit my project's settings page
80 And I click the "Edit" tab 66 And I click the "Edit" tab
81 - Then the active sub tab should be Edit  
82 - And no other sub tabs should be active 67 + Then the active sub nav should be Edit
  68 + And no other sub navs should be active
83 And the active main tab should be Settings 69 And the active main tab should be Settings
84 70
85 Scenario: On Project Settings/Hooks 71 Scenario: On Project Settings/Hooks
86 Given I visit my project's settings page 72 Given I visit my project's settings page
87 And I click the "Hooks" tab 73 And I click the "Hooks" tab
88 - Then the active sub tab should be Hooks  
89 - And no other sub tabs should be active 74 + Then the active sub nav should be Hooks
  75 + And no other sub navs should be active
90 And the active main tab should be Settings 76 And the active main tab should be Settings
91 77
92 Scenario: On Project Settings/Deploy Keys 78 Scenario: On Project Settings/Deploy Keys
93 Given I visit my project's settings page 79 Given I visit my project's settings page
94 And I click the "Deploy Keys" tab 80 And I click the "Deploy Keys" tab
95 - Then the active sub tab should be Deploy Keys  
96 - And no other sub tabs should be active 81 + Then the active sub nav should be Deploy Keys
  82 + And no other sub navs should be active
97 And the active main tab should be Settings 83 And the active main tab should be Settings
98 84
99 # Sub Tabs: Commits 85 # Sub Tabs: Commits
features/steps/project/project_active_tab.rb
@@ -68,32 +68,20 @@ class ProjectActiveTab < Spinach::FeatureSteps @@ -68,32 +68,20 @@ class ProjectActiveTab < Spinach::FeatureSteps
68 click_link('Deploy Keys') 68 click_link('Deploy Keys')
69 end 69 end
70 70
71 - Then 'the active sub tab should be Show' do  
72 - ensure_active_sub_tab('Show') 71 + Then 'the active sub nav should be Team' do
  72 + ensure_active_sub_nav('Members')
73 end 73 end
74 74
75 - Then 'the active sub tab should be Team' do  
76 - ensure_active_sub_tab('Members') 75 + Then 'the active sub nav should be Edit' do
  76 + ensure_active_sub_nav('Edit Project')
77 end 77 end
78 78
79 - Then 'the active sub tab should be Attachments' do  
80 - ensure_active_sub_tab('Attachments') 79 + Then 'the active sub nav should be Hooks' do
  80 + ensure_active_sub_nav('Web Hooks')
81 end 81 end
82 82
83 - Then 'the active sub tab should be Snippets' do  
84 - ensure_active_sub_tab('Snippets')  
85 - end  
86 -  
87 - Then 'the active sub tab should be Edit' do  
88 - ensure_active_sub_tab('Edit')  
89 - end  
90 -  
91 - Then 'the active sub tab should be Hooks' do  
92 - ensure_active_sub_tab('Web Hooks')  
93 - end  
94 -  
95 - Then 'the active sub tab should be Deploy Keys' do  
96 - ensure_active_sub_tab('Deploy Keys') 83 + Then 'the active sub nav should be Deploy Keys' do
  84 + ensure_active_sub_nav('Deploy Keys')
97 end 85 end
98 86
99 # Sub Tabs: Commits 87 # Sub Tabs: Commits
features/steps/shared/active_tab.rb
@@ -13,6 +13,10 @@ module SharedActiveTab @@ -13,6 +13,10 @@ module SharedActiveTab
13 page.find('div.content ul.nav-tabs li.active').should have_content(content) 13 page.find('div.content ul.nav-tabs li.active').should have_content(content)
14 end 14 end
15 15
  16 + def ensure_active_sub_nav(content)
  17 + page.find('div.content ul.nav-stacked-menu li.active').should have_content(content)
  18 + end
  19 +
16 And 'no other main tabs should be active' do 20 And 'no other main tabs should be active' do
17 page.should have_selector('.main-nav li.active', count: 1) 21 page.should have_selector('.main-nav li.active', count: 1)
18 end 22 end
@@ -20,4 +24,8 @@ module SharedActiveTab @@ -20,4 +24,8 @@ module SharedActiveTab
20 And 'no other sub tabs should be active' do 24 And 'no other sub tabs should be active' do
21 page.should have_selector('div.content ul.nav-tabs li.active', count: 1) 25 page.should have_selector('div.content ul.nav-tabs li.active', count: 1)
22 end 26 end
  27 +
  28 + And 'no other sub navs should be active' do
  29 + page.should have_selector('div.content ul.nav-stacked-menu li.active', count: 1)
  30 + end
23 end 31 end