2012-09-10 11:27:11 +00:00
|
|
|
class ProjectBrowseBranches < Spinach::FeatureSteps
|
2012-09-10 15:35:03 +00:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedProject
|
|
|
|
include SharedPaths
|
|
|
|
|
2014-02-24 12:55:27 +00:00
|
|
|
step 'I click link "All"' do
|
2012-09-10 11:27:11 +00:00
|
|
|
click_link "All"
|
|
|
|
end
|
|
|
|
|
2014-02-24 12:55:27 +00:00
|
|
|
step 'I should see "Shop" all branches list' do
|
2012-09-10 11:27:11 +00:00
|
|
|
page.should have_content "Branches"
|
|
|
|
page.should have_content "master"
|
|
|
|
end
|
|
|
|
|
2014-02-24 12:55:27 +00:00
|
|
|
step 'I click link "Protected"' do
|
2012-09-10 11:27:11 +00:00
|
|
|
click_link "Protected"
|
|
|
|
end
|
|
|
|
|
2014-02-24 12:55:27 +00:00
|
|
|
step 'I should see "Shop" protected branches list' do
|
2013-07-18 11:11:17 +00:00
|
|
|
within ".protected-branches-list" do
|
2012-09-10 11:27:11 +00:00
|
|
|
page.should have_content "stable"
|
|
|
|
page.should_not have_content "master"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-02-24 12:55:27 +00:00
|
|
|
step 'project "Shop" has protected branches' do
|
2014-01-19 18:55:59 +00:00
|
|
|
project = Project.find_by(name: "Shop")
|
2013-05-05 14:01:10 +00:00
|
|
|
project.protected_branches.create(name: "stable")
|
2012-09-10 11:27:11 +00:00
|
|
|
end
|
2014-02-24 12:55:27 +00:00
|
|
|
|
|
|
|
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
|
2014-05-23 11:33:20 +00:00
|
|
|
within '.tree-ref-holder' do
|
2014-02-24 12:55:27 +00:00
|
|
|
page.should have_content 'deploy_keys'
|
|
|
|
end
|
|
|
|
end
|
2012-09-10 11:27:11 +00:00
|
|
|
end
|