2012-09-26 02:11:57 +02:00
|
|
|
module SharedActiveTab
|
|
|
|
include Spinach::DSL
|
|
|
|
|
|
|
|
def ensure_active_main_tab(content)
|
2013-01-31 11:08:56 +01:00
|
|
|
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
|
2012-09-26 04:07:41 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def ensure_active_sub_tab(content)
|
|
|
|
page.find('div.content ul.nav-tabs li.active').should have_content(content)
|
2012-09-26 02:11:57 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
And 'no other main tabs should be active' do
|
2012-09-26 04:07:41 +02:00
|
|
|
page.should have_selector('ul.main_menu li.active', count: 1)
|
|
|
|
end
|
|
|
|
|
|
|
|
And 'no other sub tabs should be active' do
|
|
|
|
page.should have_selector('div.content ul.nav-tabs li.active', count: 1)
|
2012-09-26 02:11:57 +02:00
|
|
|
end
|
|
|
|
end
|