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/helpers | |
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/helpers')
-rw-r--r-- | spec/helpers/visibility_level_helper_spec.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/helpers/visibility_level_helper_spec.rb b/spec/helpers/visibility_level_helper_spec.rb index a3be222b7bd..e565ac8c530 100644 --- a/spec/helpers/visibility_level_helper_spec.rb +++ b/spec/helpers/visibility_level_helper_spec.rb @@ -1,6 +1,8 @@ require 'spec_helper' describe VisibilityLevelHelper do + include ProjectForksHelper + let(:project) { build(:project) } let(:group) { build(:group) } let(:personal_snippet) { build(:personal_snippet) } @@ -83,13 +85,13 @@ describe VisibilityLevelHelper do describe "disallowed_visibility_level?" do describe "forks" do - let(:project) { create(:project, :internal) } - let(:fork_project) { create(:project, forked_from_project: project) } + let(:project) { create(:project, :internal) } + let(:forked_project) { fork_project(project) } it "disallows levels" do - expect(disallowed_visibility_level?(fork_project, Gitlab::VisibilityLevel::PUBLIC)).to be_truthy - expect(disallowed_visibility_level?(fork_project, Gitlab::VisibilityLevel::INTERNAL)).to be_falsey - expect(disallowed_visibility_level?(fork_project, Gitlab::VisibilityLevel::PRIVATE)).to be_falsey + expect(disallowed_visibility_level?(forked_project, Gitlab::VisibilityLevel::PUBLIC)).to be_truthy + expect(disallowed_visibility_level?(forked_project, Gitlab::VisibilityLevel::INTERNAL)).to be_falsey + expect(disallowed_visibility_level?(forked_project, Gitlab::VisibilityLevel::PRIVATE)).to be_falsey end end |