blob: d504fda3327d476bb799ba5e4d8f131092b358c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
module SharedActiveTab
include Spinach::DSL
def ensure_active_main_tab(content)
if content == "Home"
page.find('.main-nav li.active').should have_css('i.icon-home')
else
page.find('.main-nav li.active').should have_content(content)
end
end
def ensure_active_sub_tab(content)
page.find('div.content ul.nav-tabs li.active').should have_content(content)
end
def ensure_active_sub_nav(content)
page.find('div.content ul.nav-stacked-menu li.active').should have_content(content)
end
And 'no other main tabs should be active' do
page.should have_selector('.main-nav 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)
end
And 'no other sub navs should be active' do
page.should have_selector('div.content ul.nav-stacked-menu li.active', count: 1)
end
end
|