2012-09-25 20:11:57 -04:00
|
|
|
module SharedActiveTab
|
|
|
|
include Spinach::DSL
|
2017-05-17 14:25:13 -04:00
|
|
|
include WaitForRequests
|
2017-04-26 05:19:20 -04:00
|
|
|
|
|
|
|
after do
|
2017-05-17 14:25:13 -04:00
|
|
|
wait_for_requests if javascript_test?
|
2017-04-26 05:19:20 -04:00
|
|
|
end
|
2012-09-25 20:11:57 -04:00
|
|
|
|
|
|
|
def ensure_active_main_tab(content)
|
2017-08-15 07:43:47 -04:00
|
|
|
expect(find('.sidebar-top-level-items > li.active')).to have_content(content)
|
2012-09-25 22:07:41 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def ensure_active_sub_tab(content)
|
2017-08-15 07:43:47 -04:00
|
|
|
expect(find('.sidebar-sub-level-items > li.active')).to 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)
|
2016-05-16 13:36:27 -04:00
|
|
|
expect(find('.layout-nav .controls li.active')).to 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
|
2017-08-15 07:43:47 -04:00
|
|
|
expect(page).to have_selector('.sidebar-top-level-items > 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
|
2017-08-15 07:43:47 -04:00
|
|
|
expect(page).to have_selector('.sidebar-sub-level-items > 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
|
2016-05-16 13:36:27 -04:00
|
|
|
expect(page).to have_selector('.layout-nav .controls li.active', count: 1)
|
2014-08-21 04:14:31 -04:00
|
|
|
end
|
2012-09-25 20:11:57 -04:00
|
|
|
end
|