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

  def ensure_active_main_tab(content)
5 6 7 8 9
    page.find('ul.main_menu li.active').should have_content(content)
  end

  def ensure_active_sub_tab(content)
    page.find('div.content ul.nav-tabs li.active').should have_content(content)
10 11 12
  end

  And 'no other main tabs should be active' do
13 14 15 16 17
    page.should have_selector('ul.main_menu li.active', count: 1)
  end

  And 'no other sub tabs should be active' do
    page.should have_selector('div.content ul.nav-tabs li.active', count: 1)
18 19
  end
end