2014-10-02 12:42:54 -04:00
|
|
|
class Spinach::Features::ProjectFork < Spinach::FeatureSteps
|
2013-03-19 11:37:50 -04:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedPaths
|
|
|
|
include SharedProject
|
|
|
|
|
|
|
|
step 'I click link "Fork"' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content "Shop"
|
|
|
|
expect(page).to have_content "Fork"
|
2013-03-19 11:37:50 -04:00
|
|
|
click_link "Fork"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I am a member of project "Shop"' do
|
2014-07-31 12:35:07 -04:00
|
|
|
@project = create(:project, name: "Shop")
|
2013-03-19 11:37:50 -04:00
|
|
|
@project.team << [@user, :reporter]
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see the forked project page' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content "Project was successfully forked."
|
2013-03-19 11:37:50 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I already have a project named "Shop" in my namespace' do
|
2014-01-22 14:03:52 -05:00
|
|
|
@my_project = create(:project, name: "Shop", namespace: current_user.namespace)
|
2013-03-19 11:37:50 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see a "Name has already been taken" warning' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content "Name has already been taken"
|
2013-03-19 11:37:50 -04:00
|
|
|
end
|
2014-11-14 09:06:39 -05:00
|
|
|
|
|
|
|
step 'I fork to my namespace' do
|
|
|
|
within '.fork-namespaces' do
|
|
|
|
click_link current_user.name
|
|
|
|
end
|
|
|
|
end
|
2013-06-22 11:57:34 -04:00
|
|
|
end
|