2013-03-19 11:37:50 -04:00
|
|
|
class ForkProject < Spinach::FeatureSteps
|
|
|
|
include SharedAuthentication
|
|
|
|
include SharedPaths
|
|
|
|
include SharedProject
|
|
|
|
|
|
|
|
step 'I click link "Fork"' do
|
2013-04-25 10:15:33 -04:00
|
|
|
page.should have_content "Shop"
|
|
|
|
page.should have_content "Fork"
|
2013-03-19 11:37:50 -04:00
|
|
|
Gitlab::Shell.any_instance.stub(:fork_repository).and_return(true)
|
|
|
|
click_link "Fork"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I am a member of project "Shop"' do
|
2014-01-19 13:55:59 -05:00
|
|
|
@project = Project.find_by(name: "Shop")
|
2014-01-22 14:03:52 -05:00
|
|
|
@project ||= create(:project, name: "Shop", group: create(:group))
|
2013-03-19 11:37:50 -04:00
|
|
|
@project.team << [@user, :reporter]
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see the forked project page' do
|
|
|
|
page.should have_content "Project was successfully forked."
|
|
|
|
current_path.should include current_user.namespace.path
|
2014-01-19 13:55:59 -05:00
|
|
|
@forked_project = Project.find_by(namespace_id: current_user.namespace.path)
|
2013-03-19 11:37:50 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I already have a project named "Shop" in my namespace' do
|
2013-04-25 10:15:33 -04:00
|
|
|
current_user.namespace ||= create(:namespace)
|
|
|
|
current_user.namespace.should_not be_nil
|
|
|
|
current_user.namespace.path.should_not be_nil
|
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
|
|
|
|
page.should have_content "Name has already been taken"
|
|
|
|
end
|
|
|
|
|
2013-06-22 11:57:34 -04:00
|
|
|
end
|