BigW Consortium Gitlab

browse_branches.rb 1.22 KB
Newer Older
1
class ProjectBrowseBranches < Spinach::FeatureSteps
Nihad Abbasov committed
2 3 4 5
  include SharedAuthentication
  include SharedProject
  include SharedPaths

6
  step 'I should see "Shop" recent branches list' do
7 8 9 10
    page.should have_content "Branches"
    page.should have_content "master"
  end

11
  step 'I click link "All"' do
12 13 14
    click_link "All"
  end

15
  step 'I should see "Shop" all branches list' do
16 17 18 19
    page.should have_content "Branches"
    page.should have_content "master"
  end

20
  step 'I click link "Protected"' do
21 22 23
    click_link "Protected"
  end

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

31
  step 'project "Shop" has protected branches' do
skv committed
32
    project = Project.find_by(name: "Shop")
33
    project.protected_branches.create(name: "stable")
34
  end
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50

  step 'I click new branch link' do
    click_link "New branch"
  end

  step 'I submit new branch form' do
    fill_in 'branch_name', with: 'deploy_keys'
    fill_in 'ref', with: 'master'
    click_button 'Create branch'
  end

  step 'I should see new branch created' do
    within '.all-branches' do
      page.should have_content 'deploy_keys'
    end
  end
51
end