Commit 38f273e3 authored by Yorick Peterse's avatar Yorick Peterse

Merge branch...

Merge branch '6578-extract-ee-specific-files-lines-for-spec-features-security-project-snippet' into 'master'

Resolve "Extract EE specific files/lines for spec/features/security/project/snippet"

Closes #6578

See merge request gitlab-org/gitlab-ee!13275
parents 3b4d8dce 9e449d2e
require 'spec_helper'
describe "Internal Project Snippets Access" do
include AccessMatchers
let(:project) { create(:project, :internal) }
let(:internal_snippet) { create(:project_snippet, :internal, project: project, author: project.owner) }
let(:private_snippet) { create(:project_snippet, :private, project: project, author: project.owner) }
describe "GET /:project_path/snippets" do
subject { project_snippets_path(project) }
it { is_expected.to be_allowed_for(:auditor) }
end
describe "GET /:project_path/snippets/new" do
subject { new_project_snippet_path(project) }
it { is_expected.to be_denied_for(:auditor) }
end
describe "GET /:project_path/snippets/:id" do
context "for an internal snippet" do
subject { project_snippet_path(project, internal_snippet) }
it { is_expected.to be_allowed_for(:auditor) }
end
context "for a private snippet" do
subject { project_snippet_path(project, private_snippet) }
it { is_expected.to be_allowed_for(:auditor) }
end
end
describe "GET /:project_path/snippets/:id/raw" do
context "for an internal snippet" do
subject { raw_project_snippet_path(project, internal_snippet) }
it { is_expected.to be_allowed_for(:auditor) }
end
context "for a private snippet" do
subject { raw_project_snippet_path(project, private_snippet) }
it { is_expected.to be_allowed_for(:auditor) }
end
end
end
require 'spec_helper'
describe "Private Project Snippets Access" do
include AccessMatchers
let(:project) { create(:project, :private) }
let(:private_snippet) { create(:project_snippet, :private, project: project, author: project.owner) }
describe "GET /:project_path/snippets" do
subject { project_snippets_path(project) }
it { is_expected.to be_allowed_for(:auditor) }
end
describe "GET /:project_path/snippets/new" do
subject { new_project_snippet_path(project) }
it { is_expected.to be_denied_for(:auditor) }
end
describe "GET /:project_path/snippets/:id for a private snippet" do
subject { project_snippet_path(project, private_snippet) }
it { is_expected.to be_allowed_for(:auditor) }
end
describe "GET /:project_path/snippets/:id/raw for a private snippet" do
subject { raw_project_snippet_path(project, private_snippet) }
it { is_expected.to be_allowed_for(:auditor) }
end
end
require 'spec_helper'
describe "Public Project Snippets Access" do
include AccessMatchers
let(:project) { create(:project, :public) }
let(:public_snippet) { create(:project_snippet, :public, project: project, author: project.owner) }
let(:internal_snippet) { create(:project_snippet, :internal, project: project, author: project.owner) }
let(:private_snippet) { create(:project_snippet, :private, project: project, author: project.owner) }
describe "GET /:project_path/snippets" do
subject { project_snippets_path(project) }
it { is_expected.to be_allowed_for(:auditor) }
end
describe "GET /:project_path/snippets/new" do
subject { new_project_snippet_path(project) }
it { is_expected.to be_denied_for(:auditor) }
end
describe "GET /:project_path/snippets/:id" do
context "for a public snippet" do
subject { project_snippet_path(project, public_snippet) }
it { is_expected.to be_allowed_for(:auditor) }
end
context "for an internal snippet" do
subject { project_snippet_path(project, internal_snippet) }
it { is_expected.to be_allowed_for(:auditor) }
end
context "for a private snippet" do
subject { project_snippet_path(project, private_snippet) }
it { is_expected.to be_allowed_for(:auditor) }
end
end
describe "GET /:project_path/snippets/:id/raw" do
context "for a public snippet" do
subject { raw_project_snippet_path(project, public_snippet) }
it { is_expected.to be_allowed_for(:auditor) }
end
context "for an internal snippet" do
subject { raw_project_snippet_path(project, internal_snippet) }
it { is_expected.to be_allowed_for(:auditor) }
end
context "for a private snippet" do
subject { raw_project_snippet_path(project, private_snippet) }
it { is_expected.to be_allowed_for(:auditor) }
end
end
end
......@@ -12,7 +12,6 @@ describe "Internal Project Snippets Access" do
subject { project_snippets_path(project) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......@@ -27,7 +26,6 @@ describe "Internal Project Snippets Access" do
subject { new_project_snippet_path(project) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_denied_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......@@ -43,7 +41,6 @@ describe "Internal Project Snippets Access" do
subject { project_snippet_path(project, internal_snippet) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......@@ -58,7 +55,6 @@ describe "Internal Project Snippets Access" do
subject { project_snippet_path(project, private_snippet) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......@@ -75,7 +71,6 @@ describe "Internal Project Snippets Access" do
subject { raw_project_snippet_path(project, internal_snippet) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......@@ -90,7 +85,6 @@ describe "Internal Project Snippets Access" do
subject { raw_project_snippet_path(project, private_snippet) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......
......@@ -11,7 +11,6 @@ describe "Private Project Snippets Access" do
subject { project_snippets_path(project) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......@@ -26,7 +25,6 @@ describe "Private Project Snippets Access" do
subject { new_project_snippet_path(project) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_denied_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......@@ -41,7 +39,6 @@ describe "Private Project Snippets Access" do
subject { project_snippet_path(project, private_snippet) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......@@ -56,7 +53,6 @@ describe "Private Project Snippets Access" do
subject { raw_project_snippet_path(project, private_snippet) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......
......@@ -13,7 +13,6 @@ describe "Public Project Snippets Access" do
subject { project_snippets_path(project) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......@@ -28,7 +27,6 @@ describe "Public Project Snippets Access" do
subject { new_project_snippet_path(project) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_denied_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......@@ -44,7 +42,6 @@ describe "Public Project Snippets Access" do
subject { project_snippet_path(project, public_snippet) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......@@ -59,7 +56,6 @@ describe "Public Project Snippets Access" do
subject { project_snippet_path(project, internal_snippet) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......@@ -74,7 +70,6 @@ describe "Public Project Snippets Access" do
subject { project_snippet_path(project, private_snippet) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......@@ -91,7 +86,6 @@ describe "Public Project Snippets Access" do
subject { raw_project_snippet_path(project, public_snippet) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......@@ -106,7 +100,6 @@ describe "Public Project Snippets Access" do
subject { raw_project_snippet_path(project, internal_snippet) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......@@ -121,7 +114,6 @@ describe "Public Project Snippets Access" do
subject { raw_project_snippet_path(project, private_snippet) }
it { is_expected.to be_allowed_for(:admin) }
it { is_expected.to be_allowed_for(:auditor) }
it { is_expected.to be_allowed_for(:owner).of(project) }
it { is_expected.to be_allowed_for(:maintainer).of(project) }
it { is_expected.to be_allowed_for(:developer).of(project) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment