OSDN Git Service

fix active tabs tests
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Thu, 31 Jan 2013 10:08:56 +0000 (12:08 +0200)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Thu, 31 Jan 2013 10:08:56 +0000 (12:08 +0200)
features/steps/admin/admin_active_tab.rb
features/steps/profile/profile_active_tab.rb
features/steps/project/project_active_tab.rb
features/steps/shared/active_tab.rb

index 48ec7ba..f14c5f3 100644 (file)
@@ -4,7 +4,7 @@ class AdminActiveTab < Spinach::FeatureSteps
   include SharedActiveTab
 
   Then 'the active main tab should be Home' do
-    ensure_active_main_tab('Stats')
+    ensure_active_main_tab('Home')
   end
 
   Then 'the active main tab should be Projects' do
index 1924a6f..ee9f5f2 100644 (file)
@@ -4,7 +4,7 @@ class ProfileActiveTab < Spinach::FeatureSteps
   include SharedActiveTab
 
   Then 'the active main tab should be Home' do
-    ensure_active_main_tab('Profile')
+    ensure_active_main_tab('Home')
   end
 
   Then 'the active main tab should be Account' do
index a5c8035..bce67c8 100644 (file)
@@ -7,7 +7,7 @@ class ProjectActiveTab < Spinach::FeatureSteps
   # Main Tabs
 
   Then 'the active main tab should be Home' do
-    ensure_active_main_tab(@project.name)
+    ensure_active_main_tab('Home')
   end
 
   Then 'the active main tab should be Files' do
index 884f2d5..446e3b9 100644 (file)
@@ -2,7 +2,11 @@ module SharedActiveTab
   include Spinach::DSL
 
   def ensure_active_main_tab(content)
-    page.find('ul.main_menu li.active').should have_content(content)
+    if content == "Home"
+      page.find('ul.main_menu li.active').should have_css('i.icon-home')
+    else
+      page.find('ul.main_menu li.active').should have_content(content)
+    end
   end
 
   def ensure_active_sub_tab(content)