2012-09-26 00:11:57 +00:00
|
|
|
module SharedActiveTab
|
|
|
|
include Spinach::DSL
|
|
|
|
|
|
|
|
def ensure_active_main_tab(content)
|
2016-05-16 17:36:27 +00:00
|
|
|
expect(find('.layout-nav li.active')).to have_content(content)
|
2012-09-26 02:07:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def ensure_active_sub_tab(content)
|
2016-06-10 15:33:44 +00:00
|
|
|
expect(find('.sub-nav li.active')).to have_content(content)
|
2012-09-26 00:11:57 +00:00
|
|
|
end
|
|
|
|
|
2013-06-19 19:52:57 +00:00
|
|
|
def ensure_active_sub_nav(content)
|
2016-05-16 17:36:27 +00:00
|
|
|
expect(find('.layout-nav .controls li.active')).to have_content(content)
|
2013-06-19 19:52:57 +00:00
|
|
|
end
|
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'no other main tabs should be active' do
|
2016-05-16 17:36:27 +00:00
|
|
|
expect(page).to have_selector('.layout-nav .nav-links > li.active', count: 1)
|
2012-09-26 02:07:41 +00:00
|
|
|
end
|
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'no other sub tabs should be active' do
|
2016-06-10 15:33:44 +00:00
|
|
|
expect(page).to have_selector('.sub-nav li.active', count: 1)
|
2012-09-26 00:11:57 +00:00
|
|
|
end
|
2013-06-19 19:52:57 +00:00
|
|
|
|
2014-09-21 21:40:22 +00:00
|
|
|
step 'no other sub navs should be active' do
|
2016-05-16 17:36:27 +00:00
|
|
|
expect(page).to have_selector('.layout-nav .controls li.active', count: 1)
|
2014-08-21 08:14:31 +00:00
|
|
|
end
|
2012-09-26 00:11:57 +00:00
|
|
|
end
|