Commit 53832eff authored by Samantha Ming's avatar Samantha Ming

Add feature spec for creating fork

Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/323301
parent 2054a1e8
......@@ -118,6 +118,50 @@ RSpec.describe 'Project fork' do
it_behaves_like 'fork button on project page'
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
before do
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