Commit 2af323bbd1993b121b2ff7bcc695e2bb10af5a1b

Authored by Dmitriy Zaporozhets
1 parent 130f60d5

fix active tabs tests

features/steps/admin/admin_active_tab.rb
@@ -4,7 +4,7 @@ class AdminActiveTab < Spinach::FeatureSteps @@ -4,7 +4,7 @@ class AdminActiveTab < Spinach::FeatureSteps
4 include SharedActiveTab 4 include SharedActiveTab
5 5
6 Then 'the active main tab should be Home' do 6 Then 'the active main tab should be Home' do
7 - ensure_active_main_tab('Stats') 7 + ensure_active_main_tab('Home')
8 end 8 end
9 9
10 Then 'the active main tab should be Projects' do 10 Then 'the active main tab should be Projects' do
features/steps/profile/profile_active_tab.rb
@@ -4,7 +4,7 @@ class ProfileActiveTab < Spinach::FeatureSteps @@ -4,7 +4,7 @@ class ProfileActiveTab < Spinach::FeatureSteps
4 include SharedActiveTab 4 include SharedActiveTab
5 5
6 Then 'the active main tab should be Home' do 6 Then 'the active main tab should be Home' do
7 - ensure_active_main_tab('Profile') 7 + ensure_active_main_tab('Home')
8 end 8 end
9 9
10 Then 'the active main tab should be Account' do 10 Then 'the active main tab should be Account' do
features/steps/project/project_active_tab.rb
@@ -7,7 +7,7 @@ class ProjectActiveTab < Spinach::FeatureSteps @@ -7,7 +7,7 @@ class ProjectActiveTab < Spinach::FeatureSteps
7 # Main Tabs 7 # Main Tabs
8 8
9 Then 'the active main tab should be Home' do 9 Then 'the active main tab should be Home' do
10 - ensure_active_main_tab(@project.name) 10 + ensure_active_main_tab('Home')
11 end 11 end
12 12
13 Then 'the active main tab should be Files' do 13 Then 'the active main tab should be Files' do
features/steps/shared/active_tab.rb
@@ -2,7 +2,11 @@ module SharedActiveTab @@ -2,7 +2,11 @@ module SharedActiveTab
2 include Spinach::DSL 2 include Spinach::DSL
3 3
4 def ensure_active_main_tab(content) 4 def ensure_active_main_tab(content)
5 - page.find('ul.main_menu li.active').should have_content(content) 5 + if content == "Home"
  6 + page.find('ul.main_menu li.active').should have_css('i.icon-home')
  7 + else
  8 + page.find('ul.main_menu li.active').should have_content(content)
  9 + end
6 end 10 end
7 11
8 def ensure_active_sub_tab(content) 12 def ensure_active_sub_tab(content)