2015-04-26 12:48:37 +05:30
|
|
|
class Spinach::Features::ProjectFork < Spinach::FeatureSteps
|
2014-09-02 18:07:02 +05:30
|
|
|
include SharedAuthentication
|
|
|
|
include SharedPaths
|
|
|
|
include SharedProject
|
|
|
|
|
|
|
|
step 'I click link "Fork"' do
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(page).to have_content "Shop"
|
|
|
|
expect(page).to have_content "Fork"
|
2014-09-02 18:07:02 +05:30
|
|
|
click_link "Fork"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I am a member of project "Shop"' do
|
|
|
|
@project = create(:project, name: "Shop")
|
|
|
|
@project.team << [@user, :reporter]
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see the forked project page' do
|
2015-09-25 12:07:36 +05:30
|
|
|
expect(page).to have_content "Forked from"
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
step 'I already have a project named "Shop" in my namespace' do
|
|
|
|
@my_project = create(:project, name: "Shop", namespace: current_user.namespace)
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see a "Name has already been taken" warning' do
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(page).to have_content "Name has already been taken"
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
2015-04-26 12:48:37 +05:30
|
|
|
|
|
|
|
step 'I fork to my namespace' do
|
2015-09-11 14:41:01 +05:30
|
|
|
page.within '.fork-namespaces' do
|
2015-04-26 12:48:37 +05:30
|
|
|
click_link current_user.name
|
|
|
|
end
|
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|