2014-10-02 16:42:54 +00:00
|
|
|
class Spinach::Features::ProjectFork < Spinach::FeatureSteps
|
2013-03-19 15:37:50 +00:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedPaths
|
|
|
|
include SharedProject
|
|
|
|
|
|
|
|
step 'I click link "Fork"' do
|
2015-06-12 04:44:13 +00:00
|
|
|
expect(page).to have_content "Shop"
|
2015-09-25 08:04:09 +00:00
|
|
|
click_link "Fork project"
|
2013-03-19 15:37:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I am a member of project "Shop"' do
|
2014-07-31 16:35:07 +00:00
|
|
|
@project = create(:project, name: "Shop")
|
2013-03-19 15:37:50 +00:00
|
|
|
@project.team << [@user, :reporter]
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see the forked project page' do
|
2015-09-01 07:56:40 +00:00
|
|
|
expect(page).to have_content "Forked from"
|
2013-03-19 15:37:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I already have a project named "Shop" in my namespace' do
|
2014-01-22 19:03:52 +00:00
|
|
|
@my_project = create(:project, name: "Shop", namespace: current_user.namespace)
|
2013-03-19 15:37:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see a "Name has already been taken" warning' do
|
2015-06-12 04:44:13 +00:00
|
|
|
expect(page).to have_content "Name has already been taken"
|
2013-03-19 15:37:50 +00:00
|
|
|
end
|
2014-11-14 14:06:39 +00:00
|
|
|
|
|
|
|
step 'I fork to my namespace' do
|
2015-06-12 05:36:00 +00:00
|
|
|
page.within '.fork-namespaces' do
|
2014-11-14 14:06:39 +00:00
|
|
|
click_link current_user.name
|
|
|
|
end
|
|
|
|
end
|
2015-12-23 15:20:07 +00:00
|
|
|
|
2015-12-25 16:30:48 +00:00
|
|
|
step 'I should see "New merge request"' do
|
|
|
|
expect(page).to have_content(/new merge request/i)
|
2015-12-23 15:20:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I goto the Merge Requests page' do
|
|
|
|
page.within '.page-sidebar-expanded' do
|
|
|
|
click_link "Merge Requests"
|
|
|
|
end
|
|
|
|
end
|
2015-12-25 16:30:48 +00:00
|
|
|
|
|
|
|
step 'I click link "New merge request"' do
|
|
|
|
expect(page).to have_content(/new merge request/i)
|
|
|
|
click_link "New Merge Request"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see the new merge request page for my namespace' do
|
|
|
|
current_path.should have_content(/#{current_user.namespace.name}/i)
|
|
|
|
end
|
2013-06-22 15:57:34 +00:00
|
|
|
end
|