diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-11-03 11:08:36 +0100 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-11-03 11:08:36 +0100 |
commit | 39d00bddc494c7f13527887e005b53431642d24c (patch) | |
tree | 0eddca2a370d8d93897a99d46960ee33ad9ba58f /spec/features/projects | |
parent | 5c147b6b8ef3f543f98c15ce2a54d4e3f2821303 (diff) | |
download | gitlab-ce-39d00bddc494c7f13527887e005b53431642d24c.tar.gz |
Make sure the settings page renders when root of a fork is deleted
Diffstat (limited to 'spec/features/projects')
-rw-r--r-- | spec/features/projects/settings/forked_project_settings_spec.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/features/projects/settings/forked_project_settings_spec.rb b/spec/features/projects/settings/forked_project_settings_spec.rb new file mode 100644 index 00000000000..28954a4fb40 --- /dev/null +++ b/spec/features/projects/settings/forked_project_settings_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +feature 'Settings for a forked project', :js do + include ProjectForksHelper + let(:user) { create(:user) } + let(:original_project) { create(:project) } + let(:forked_project) { fork_project(original_project, user) } + + before do + original_project.add_master(user) + forked_project.add_master(user) + sign_in(user) + end + + shared_examples 'project settings for a forked projects' do + it 'allows deleting the link to the forked project' do + visit edit_project_path(forked_project) + + click_button 'Remove fork relationship' + + wait_for_requests + + fill_in('confirm_name_input', with: forked_project.name) + click_button('Confirm') + + expect(page).to have_content('The fork relationship has been removed.') + expect(forked_project.reload.forked?).to be_falsy + end + end + + it_behaves_like 'project settings for a forked projects' + + context 'when the original project is deleted' do + before do + original_project.destroy! + end + + it_behaves_like 'project settings for a forked projects' + end +end |