active_tab.rb 2.08 KB
Newer Older
1
class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
2 3 4 5
  include SharedAuthentication
  include SharedPaths
  include SharedProject
  include SharedActiveTab
6
  include SharedProjectTab
7 8 9

  # Sub Tabs: Home

10
  step 'I click the "Team" tab' do
11
    click_link('Members')
12 13
  end

14
  step 'I click the "Attachments" tab' do
15 16 17
    click_link('Attachments')
  end

18
  step 'I click the "Snippets" tab' do
19 20 21
    page.within('.layout-nav') do
      click_link('Snippets')
    end
22 23
  end

24 25 26
  step 'I click the "Edit Project"' do
    page.within '.layout-nav .controls' do
      click_link('Edit Project')
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
27
    end
28 29
  end

30
  step 'I click the "Hooks" tab' do
ashleys's avatar
ashleys committed
31
    click_link('Webhooks')
32 33
  end

34
  step 'I click the "Deploy Keys" tab' do
35 36 37
    click_link('Deploy Keys')
  end

38
  step 'the active sub nav should be Members' do
39
    ensure_active_sub_nav('Members')
40 41
  end

42
  step 'the active sub nav should be Hooks' do
ashleys's avatar
ashleys committed
43
    ensure_active_sub_nav('Webhooks')
44 45
  end

46
  step 'the active sub nav should be Deploy Keys' do
47
    ensure_active_sub_nav('Deploy Keys')
48 49 50 51
  end

  # Sub Tabs: Commits

52
  step 'I click the "Compare" tab' do
53 54 55
    click_link('Compare')
  end

56
  step 'I click the "Branches" tab' do
57
    page.within '.sub-nav' do
58 59
      click_link('Branches')
    end
60 61
  end

62
  step 'I click the "Tags" tab' do
63 64 65
    click_link('Tags')
  end

66
  step 'the active sub tab should be Compare' do
67 68 69
    ensure_active_sub_tab('Compare')
  end

70
  step 'the active sub tab should be Branches' do
71 72 73
    ensure_active_sub_tab('Branches')
  end

74
  step 'the active sub tab should be Tags' do
75 76 77 78 79
    ensure_active_sub_tab('Tags')
  end

  # Sub Tabs: Issues

80 81
  step 'I click the "Milestones" sub tab' do
    page.within('.sub-nav') do
82 83
      click_link('Milestones')
    end
84 85
  end

86 87
  step 'I click the "Labels" sub tab' do
    page.within('.sub-nav') do
88 89
      click_link('Labels')
    end
90 91
  end

92 93
  step 'the active sub tab should be Issues' do
    ensure_active_sub_tab('Issues')
94 95
  end

96 97
  step 'the active sub tab should be Milestones' do
    ensure_active_sub_tab('Milestones')
98 99
  end

100 101
  step 'the active sub tab should be Labels' do
    ensure_active_sub_tab('Labels')
102 103
  end
end