summaryrefslogtreecommitdiff
path: root/spec/helpers/projects_helper_spec.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2021-01-20 13:34:23 -0600
committerRobert Speicher <rspeicher@gmail.com>2021-01-20 13:34:23 -0600
commit6438df3a1e0fb944485cebf07976160184697d72 (patch)
tree00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /spec/helpers/projects_helper_spec.rb
parent42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff)
downloadgitlab-ce-6438df3a1e0fb944485cebf07976160184697d72.tar.gz
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'spec/helpers/projects_helper_spec.rb')
-rw-r--r--spec/helpers/projects_helper_spec.rb29
1 files changed, 2 insertions, 27 deletions
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb
index d28d5ecda1b..b920e2e5600 100644
--- a/spec/helpers/projects_helper_spec.rb
+++ b/spec/helpers/projects_helper_spec.rb
@@ -92,37 +92,11 @@ RSpec.describe ProjectsHelper do
expect(helper.can_change_visibility_level?(project, user)).to be_falsey
end
- it "returns true if there are permissions and it is not fork" do
+ it "returns true if there are permissions" do
allow(helper).to receive(:can?) { true }
expect(helper.can_change_visibility_level?(project, user)).to be_truthy
end
-
- it 'allows visibility level to be changed if the project is forked' do
- allow(helper).to receive(:can?).with(user, :change_visibility_level, project) { true }
- project.update!(visibility_level: Gitlab::VisibilityLevel::PRIVATE)
- fork_project(project)
-
- expect(helper.can_change_visibility_level?(project, user)).to be_truthy
- end
-
- context "forks" do
- it "returns false if there are permissions and origin project is PRIVATE" do
- allow(helper).to receive(:can?) { true }
-
- project.update!(visibility_level: Gitlab::VisibilityLevel::PRIVATE)
-
- expect(helper.can_change_visibility_level?(forked_project, user)).to be_falsey
- end
-
- it "returns true if there are permissions and origin project is INTERNAL" do
- allow(helper).to receive(:can?) { true }
-
- project.update!(visibility_level: Gitlab::VisibilityLevel::INTERNAL)
-
- expect(helper.can_change_visibility_level?(forked_project, user)).to be_truthy
- end
- end
end
describe '#can_disable_emails?' do
@@ -459,6 +433,7 @@ RSpec.describe ProjectsHelper do
context 'when project has external wiki' do
it 'includes external wiki tab' do
project.create_external_wiki_service(active: true, properties: { 'external_wiki_url' => 'https://gitlab.com' })
+ project.reload
is_expected.to include(:external_wiki)
end