BigW Consortium Gitlab

active_tab.rb 781 Bytes
Newer Older
1 2 3 4
module SharedActiveTab
  include Spinach::DSL

  def ensure_active_main_tab(content)
5
    expect(find('.layout-nav li.active')).to have_content(content)
6 7 8
  end

  def ensure_active_sub_tab(content)
9
    expect(find('.sub-nav li.active')).to have_content(content)
10 11
  end

12
  def ensure_active_sub_nav(content)
13
    expect(find('.layout-nav .controls li.active')).to have_content(content)
14 15
  end

16
  step 'no other main tabs should be active' do
17
    expect(page).to have_selector('.layout-nav .nav-links > li.active', count: 1)
18 19
  end

20
  step 'no other sub tabs should be active' do
21
    expect(page).to have_selector('.sub-nav li.active', count: 1)
22
  end
23

24
  step 'no other sub navs should be active' do
25
    expect(page).to have_selector('.layout-nav .controls li.active', count: 1)
26
  end
27
end