diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-11-03 13:31:29 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-11-03 14:17:59 +0300 |
commit | 7582bc8b4eacfe70ecc575f724285de471d6c743 (patch) | |
tree | 29be30bb251c7925a8a5c81e51e8b3bff904aaa0 /spec/models/fork_network_spec.rb | |
parent | 39d00bddc494c7f13527887e005b53431642d24c (diff) |
Unlink a project from a fork network when it's source was deleted.
We need to close all merge requests coming from the project within the
entire fork network.
Diffstat (limited to 'spec/models/fork_network_spec.rb')
-rw-r--r-- | spec/models/fork_network_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/fork_network_spec.rb b/spec/models/fork_network_spec.rb index 605ccd6db06..a43baf1820a 100644 --- a/spec/models/fork_network_spec.rb +++ b/spec/models/fork_network_spec.rb @@ -24,6 +24,16 @@ describe ForkNetwork do end end + describe '#merge_requests' do + it 'finds merge requests within the fork network' do + project = create(:project) + forked_project = fork_project(project) + merge_request = create(:merge_request, source_project: forked_project, target_project: project) + + expect(project.fork_network.merge_requests).to include(merge_request) + end + end + context 'for a deleted project' do it 'keeps the fork network' do project = create(:project, :public) |