diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-08-31 19:16:34 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-10-19 11:57:20 +0200 |
commit | f3fba178b931cd2ba67f81ee667893cb84e7d42f (patch) | |
tree | 24c5a688880d5edd75642a7f16623124bde9fc22 /spec/finders | |
parent | 4321d70d24a6a7dc99f80fa4211ba6250504d99b (diff) | |
download | gitlab-ce-f3fba178b931cd2ba67f81ee667893cb84e7d42f.tar.gz |
Remove the `ForkedProjectLink` model
This removes the `ForkedProjectLink` model that has been replaced by
the `ForkNetworkMember` and `ForkNetwork` combination. All existing
relations have been adjusted to use these new models.
The `forked_project_link` table has been dropped.
The "Forks" count on the admin dashboard has been updated to count all
`ForkNetworkMember` rows and deduct the number of `ForkNetwork`
rows. This is because now the "root-project" of a fork network also
has a `ForkNetworkMember` row. This count could become inaccurate when
the root of a fork network is deleted.
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/fork_projects_finder_spec.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/spec/finders/fork_projects_finder_spec.rb b/spec/finders/fork_projects_finder_spec.rb index f0cef7ea406..b3fdffc3331 100644 --- a/spec/finders/fork_projects_finder_spec.rb +++ b/spec/finders/fork_projects_finder_spec.rb @@ -1,20 +1,21 @@ require 'spec_helper' describe ForkProjectsFinder do - let(:source_project) { create(:project, :empty_repo) } - let(:private_fork) { create(:project, :private, :empty_repo, name: 'A') } - let(:internal_fork) { create(:project, :internal, :empty_repo, name: 'B') } - let(:public_fork) { create(:project, :public, :empty_repo, name: 'C') } + include ProjectForksHelper + + let(:source_project) { create(:project, :public, :empty_repo) } + let(:private_fork) { fork_project(source_project, nil, name: 'A') } + let(:internal_fork) { fork_project(source_project, nil, name: 'B') } + let(:public_fork) { fork_project(source_project, nil, name: 'C') } let(:non_member) { create(:user) } let(:private_fork_member) { create(:user) } before do + private_fork.update!(visibility_level: Gitlab::VisibilityLevel::PRIVATE) private_fork.add_developer(private_fork_member) - source_project.forks << private_fork - source_project.forks << internal_fork - source_project.forks << public_fork + internal_fork.update!(visibility_level: Gitlab::VisibilityLevel::INTERNAL) end describe '#execute' do |