project_browse_branches.rb 888 Bytes
Newer Older
1
class ProjectBrowseBranches < Spinach::FeatureSteps
Nihad Abbasov's avatar
Nihad Abbasov committed
2 3 4 5
  include SharedAuthentication
  include SharedProject
  include SharedPaths

6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
  Then 'I should see "Shop" recent branches list' do
    page.should have_content "Branches"
    page.should have_content "master"
  end

  Given 'I click link "All"' do
    click_link "All"
  end

  Then 'I should see "Shop" all branches list' do
    page.should have_content "Branches"
    page.should have_content "master"
  end

  Given 'I click link "Protected"' do
    click_link "Protected"
  end

  Then 'I should see "Shop" protected branches list' do
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
25
    within ".protected-branches-list" do
26 27 28 29 30 31
      page.should have_content "stable"
      page.should_not have_content "master"
    end
  end

  And 'project "Shop" has protected branches' do
skv's avatar
skv committed
32
    project = Project.find_by(name: "Shop")
33
    project.protected_branches.create(name: "stable")
34 35
  end
end