2012-09-25 20:11:57 -04:00
|
|
|
module SharedActiveTab
|
|
|
|
include Spinach::DSL
|
|
|
|
|
|
|
|
def ensure_active_main_tab(content)
|
2014-12-22 09:42:26 -05:00
|
|
|
find('.nav-sidebar > li.active').should have_content(content)
|
2012-09-25 22:07:41 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def ensure_active_sub_tab(content)
|
2014-09-24 02:28:41 -04:00
|
|
|
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)
|
2014-12-22 09:42:26 -05:00
|
|
|
find('.sidebar-subnav > li.active').should have_content(content)
|
2013-06-19 15:52:57 -04:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'no other main tabs should be active' do
|
2014-12-22 09:42:26 -05:00
|
|
|
page.should have_selector('.nav-sidebar > li.active', count: 1)
|
2012-09-25 22:07:41 -04:00
|
|
|
end
|
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'no other sub tabs should be active' do
|
2012-09-25 22:07:41 -04:00
|
|
|
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
|
|
|
|
2014-09-21 17:40:22 -04:00
|
|
|
step 'no other sub navs should be active' do
|
2014-12-22 09:42:26 -05:00
|
|
|
page.should have_selector('.sidebar-subnav > li.active', count: 1)
|
2013-06-19 15:52:57 -04:00
|
|
|
end
|
2014-08-21 04:14:31 -04:00
|
|
|
|
|
|
|
step 'the active main tab should be Home' do
|
|
|
|
ensure_active_main_tab('Activity')
|
|
|
|
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-25 20:11:57 -04:00
|
|
|
end
|