2012-09-26 00:11:57 +00:00
|
|
|
module SharedActiveTab
|
|
|
|
include Spinach::DSL
|
|
|
|
|
|
|
|
def ensure_active_main_tab(content)
|
2015-06-12 04:44:13 +00:00
|
|
|
expect(find('.nav-sidebar > li.active')).to have_content(content)
|
2012-09-26 02:07:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def ensure_active_sub_tab(content)
|
2015-09-07 10:45:06 +00:00
|
|
|
expect(find('div.content ul.center-top-menu 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)
|
2015-06-12 04:44:13 +00:00
|
|
|
expect(find('.sidebar-subnav > 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
|
2015-06-12 04:44:13 +00:00
|
|
|
expect(page).to have_selector('.nav-sidebar > 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
|
2015-09-07 10:45:06 +00:00
|
|
|
expect(page).to have_selector('div.content ul.center-top-menu 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
|
2015-06-12 04:44:13 +00:00
|
|
|
expect(page).to have_selector('.sidebar-subnav > li.active', count: 1)
|
2013-06-19 19:52:57 +00:00
|
|
|
end
|
2014-08-21 08:14:31 +00:00
|
|
|
|
|
|
|
step 'the active main tab should be Home' do
|
2015-08-20 10:32:44 +00:00
|
|
|
ensure_active_main_tab('Projects')
|
2014-08-21 08:14:31 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'the active main tab should be Projects' do
|
|
|
|
ensure_active_main_tab('Projects')
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'the active main tab should be Issues' do
|
|
|
|
ensure_active_main_tab('Issues')
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'the active main tab should be Merge Requests' do
|
|
|
|
ensure_active_main_tab('Merge Requests')
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'the active main tab should be Help' do
|
|
|
|
ensure_active_main_tab('Help')
|
|
|
|
end
|
2012-09-26 00:11:57 +00:00
|
|
|
end
|