diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-03 18:06:09 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-07 12:46:23 +0300 |
commit | f90b27da7777b0c72782d2a930f770e2f27757e2 (patch) | |
tree | 50f1d5b84e40c45c29a1be2b8150029da7db2d87 /spec/models/fork_network_spec.rb | |
parent | 8160550439d2027c12d5556c8ce1f8afd250628a (diff) |
Find forks within users/namespaces using fork memberships
Diffstat (limited to 'spec/models/fork_network_spec.rb')
-rw-r--r-- | spec/models/fork_network_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/fork_network_spec.rb b/spec/models/fork_network_spec.rb index 4781a959846..605ccd6db06 100644 --- a/spec/models/fork_network_spec.rb +++ b/spec/models/fork_network_spec.rb @@ -12,6 +12,18 @@ describe ForkNetwork do end end + describe '#find_fork_in' do + it 'finds all fork of the current network in al collection' do + network = create(:fork_network) + root_project = network.root_project + another_project = fork_project(root_project) + create(:project) + + expect(network.find_forks_in(Project.all)) + .to contain_exactly(another_project, root_project) + end + end + context 'for a deleted project' do it 'keeps the fork network' do project = create(:project, :public) |