summaryrefslogtreecommitdiff
path: root/features/steps/admin/active_tab.rb
blob: f2db180138981d7bcf88140dcd55d5e1e26869d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
class Spinach::Features::AdminActiveTab < Spinach::FeatureSteps
  include SharedAuthentication
  include SharedPaths
  include SharedSidebarActiveTab

  step 'the active main tab should be Home' do
    ensure_active_main_tab('Overview')
  end

  step 'the active main tab should be Projects' do
    ensure_active_main_tab('Projects')
  end

  step 'the active main tab should be Groups' do
    ensure_active_main_tab('Groups')
  end

  step 'the active main tab should be Users' do
    ensure_active_main_tab('Users')
  end

  step 'the active main tab should be Logs' do
    ensure_active_main_tab('Logs')
  end

  step 'the active main tab should be Hooks' do
    ensure_active_main_tab('Hooks')
  end

  step 'the active main tab should be Resque' do
    ensure_active_main_tab('Background Jobs')
  end

  step 'the active main tab should be Messages' do
    ensure_active_main_tab('Messages')
  end

  step 'no other main tabs should be active' do
    expect(page).to have_selector('.nav-sidebar > li.active', count: 1)
  end

  def ensure_active_main_tab(content)
    expect(find('.nav-sidebar > li.active')).to have_content(content)
  end
end