diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-11-29 15:09:10 +0100 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-11-29 15:41:22 +0100 |
commit | 299c54397340f93646755c16b778c1c38088ded2 (patch) | |
tree | a615bc5692c1980d5805e57248bd0192cb7ff1bd /spec | |
parent | a2fea9288ef0a2d714827ac5b92e7330d3cb2c3f (diff) | |
download | gitlab-ce-299c54397340f93646755c16b778c1c38088ded2.tar.gz |
Redirect to an already forked project if it exists
Before the we would try to `POST` to the project path, which would
result in a 404, because that `POST` is not supported.
By changing this back to a normal link, not not handled in JS, we can
immeadiatly redirect.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/projects/fork_spec.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/features/projects/fork_spec.rb b/spec/features/projects/fork_spec.rb index e10d29e5eea..842840cc04c 100644 --- a/spec/features/projects/fork_spec.rb +++ b/spec/features/projects/fork_spec.rb @@ -1,6 +1,8 @@ require 'spec_helper' describe 'Project fork' do + include ProjectForksHelper + let(:user) { create(:user) } let(:project) { create(:project, :public, :repository) } @@ -24,8 +26,9 @@ describe 'Project fork' do end context 'master in group' do + let(:group) { create(:group) } + before do - group = create(:group) group.add_master(user) end @@ -53,5 +56,17 @@ describe 'Project fork' do expect(page).to have_css('.fork-thumbnail', count: 2) expect(page).to have_css('.fork-thumbnail.disabled') end + + it 'links to the fork if the project was already forked within that namespace' do + forked_project = fork_project(project, user, namespace: group, repository: true) + + visit new_project_fork_path(project) + + expect(page).to have_css('div.forked', text: group.full_name) + + click_link group.full_name + + expect(current_path).to eq(project_path(forked_project)) + end end end |