2012-09-25 20:11:57 -04:00
|
|
|
module SharedActiveTab
|
|
|
|
include Spinach::DSL
|
|
|
|
|
|
|
|
def ensure_active_main_tab(content)
|
2013-01-31 05:08:56 -05:00
|
|
|
if content == "Home"
|
2013-04-02 04:23:06 -04:00
|
|
|
page.find('.main-nav li.active').should have_css('i.icon-home')
|
2013-01-31 05:08:56 -05:00
|
|
|
else
|
2013-04-02 04:23:06 -04:00
|
|
|
page.find('.main-nav li.active').should have_content(content)
|
2013-01-31 05:08:56 -05:00
|
|
|
end
|
2012-09-25 22:07:41 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def ensure_active_sub_tab(content)
|
|
|
|
page.find('div.content ul.nav-tabs li.active').should have_content(content)
|
2012-09-25 20:11:57 -04:00
|
|
|
end
|
|
|
|
|
2013-06-19 15:52:57 -04:00
|
|
|
def ensure_active_sub_nav(content)
|
|
|
|
page.find('div.content ul.nav-stacked-menu li.active').should have_content(content)
|
|
|
|
end
|
|
|
|
|
2012-09-25 20:11:57 -04:00
|
|
|
And 'no other main tabs should be active' do
|
2013-04-02 04:23:06 -04:00
|
|
|
page.should have_selector('.main-nav li.active', count: 1)
|
2012-09-25 22:07:41 -04:00
|
|
|
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-25 20:11:57 -04:00
|
|
|
end
|
2013-06-19 15:52:57 -04:00
|
|
|
|
|
|
|
And 'no other sub navs should be active' do
|
|
|
|
page.should have_selector('div.content ul.nav-stacked-menu li.active', count: 1)
|
|
|
|
end
|
2012-09-25 20:11:57 -04:00
|
|
|
end
|