Commit 062f75a4 authored by Mark Lapierre's avatar Mark Lapierre

Merge branch '323301-create-fork-feature-spec' into 'master'

Add feature spec for creating fork

See merge request gitlab-org/gitlab!55932
parents 3a757dcc 53832eff
...@@ -118,6 +118,50 @@ RSpec.describe 'Project fork' do ...@@ -118,6 +118,50 @@ RSpec.describe 'Project fork' do
it_behaves_like 'fork button on project page' it_behaves_like 'fork button on project page'
it_behaves_like 'create fork page', 'Fork project' it_behaves_like 'create fork page', 'Fork project'
context 'fork form', :js do
let(:group) { create(:group) }
let(:user) { create(:group_member, :maintainer, user: create(:user), group: group ).user }
def submit_form
select(group.name)
click_button 'Fork project'
end
it 'forks the project', :sidekiq_might_not_need_inline do
visit new_project_fork_path(project)
submit_form
expect(page).to have_content 'Forked from'
end
it 'shows the new forked project on the forks page' do
visit new_project_fork_path(project)
submit_form
wait_for_requests
visit project_forks_path(project)
page.within('.js-projects-list-holder') do
expect(page).to have_content("#{group.name} / #{project.name}")
end
end
it 'shows the filled in info forked project on the forks page' do
fork_name = 'some-name'
visit new_project_fork_path(project)
fill_in('fork-name', with: fork_name, fill_options: { clear: :backspace })
fill_in('fork-slug', with: fork_name, fill_options: { clear: :backspace })
submit_form
wait_for_requests
visit project_forks_path(project)
page.within('.js-projects-list-holder') do
expect(page).to have_content("#{group.name} / #{fork_name}")
end
end
end
context 'with fork_project_form feature flag disabled' do context 'with fork_project_form feature flag disabled' do
before do before do
stub_feature_flags(fork_project_form: false) stub_feature_flags(fork_project_form: false)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment