fork.rb 938 Bytes
Newer Older
1
class Spinach::Features::ProjectFork < Spinach::FeatureSteps
2
3
4
5
6
  include SharedAuthentication
  include SharedPaths
  include SharedProject

  step 'I click link "Fork"' do
7
8
    expect(page).to have_content "Shop"
    expect(page).to have_content "Fork"
9
10
11
12
    click_link "Fork"
  end

  step 'I am a member of project "Shop"' do
13
    @project = create(:project, name: "Shop")
14
15
16
17
    @project.team << [@user, :reporter]
  end

  step 'I should see the forked project page' do
18
    expect(page).to have_content "Forked from"
19
20
21
  end

  step 'I already have a project named "Shop" in my namespace' do
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
22
    @my_project = create(:project, name: "Shop", namespace: current_user.namespace)
23
24
25
  end

  step 'I should see a "Name has already been taken" warning' do
26
    expect(page).to have_content "Name has already been taken"
27
  end
28
29

  step 'I fork to my namespace' do
30
    page.within '.fork-namespaces' do
31
32
33
      click_link current_user.name
    end
  end
34
end