summaryrefslogtreecommitdiff
path: root/spec/controllers
diff options
context:
space:
mode:
authorKatarzyna Kobierska <kkobierska@gmail.com>2016-09-01 13:42:17 +0200
committerKatarzyna Kobierska <kkobierska@gmail.com>2016-09-13 14:40:05 +0200
commit8c77a1fb250cf6d6ca06bedc3b52fc62f1cc4819 (patch)
tree35a5860360398b88b403d532ae7c262c0ad633fa /spec/controllers
parenta0c46221626ae367c3da68e38a6d5dde7dda32db (diff)
downloadgitlab-ce-8c77a1fb250cf6d6ca06bedc3b52fc62f1cc4819.tar.gz
Before deleting project if forked unlink fork
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/projects_controller_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb
index ffe0641ddd7..95315d86c4d 100644
--- a/spec/controllers/projects_controller_spec.rb
+++ b/spec/controllers/projects_controller_spec.rb
@@ -181,6 +181,23 @@ describe ProjectsController do
expect(response).to have_http_status(302)
expect(response).to redirect_to(dashboard_projects_path)
end
+
+ context "when project is forked" do
+ let(:project) { create(:project) }
+ let(:fork_project) { create(:project, forked_from_project: project) }
+ let(:merge_request) do
+ create(:merge_request,
+ source_project: fork_project,
+ target_project: project)
+ end
+
+ it "closes all related merge requests" do
+ fork_project.destroy
+
+ expect(fork_project.destroyed?).to be_truthy
+ expect(merge_request.state).to eq('closed')
+ end
+ end
end
describe "POST #toggle_star" do