diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2017-05-08 01:35:56 +0300 |
---|---|---|
committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2017-05-08 01:35:56 +0300 |
commit | 8df3997a92bffa2d29f3c559933a336b837cdb93 (patch) | |
tree | 5ee50876b35b6c5fd40607665f72468cfcee51fe /spec/features/security | |
parent | 8a0cde81feb3c8f3af26eefa5cef7b72eda2d266 (diff) |
Add Pipeline Schedules that supersedes experimental Trigger Schedule
Diffstat (limited to 'spec/features/security')
-rw-r--r-- | spec/features/security/project/internal_access_spec.rb | 16 | ||||
-rw-r--r-- | spec/features/security/project/private_access_spec.rb | 44 | ||||
-rw-r--r-- | spec/features/security/project/public_access_spec.rb | 16 |
3 files changed, 73 insertions, 3 deletions
diff --git a/spec/features/security/project/internal_access_spec.rb b/spec/features/security/project/internal_access_spec.rb index 26879a77c48..78a76d9c112 100644 --- a/spec/features/security/project/internal_access_spec.rb +++ b/spec/features/security/project/internal_access_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe "Internal Project Access", feature: true do include AccessMatchers - let(:project) { create(:project, :internal) } + set(:project) { create(:project, :internal) } describe "Project should be internal" do describe '#internal?' do @@ -437,6 +437,20 @@ describe "Internal Project Access", feature: true do end end + describe "GET /:project_path/pipeline_schedules" do + subject { namespace_project_pipeline_schedules_path(project.namespace, project) } + + it { is_expected.to be_allowed_for(:admin) } + it { is_expected.to be_allowed_for(:owner).of(project) } + it { is_expected.to be_allowed_for(:master).of(project) } + it { is_expected.to be_allowed_for(:developer).of(project) } + it { is_expected.to be_allowed_for(:reporter).of(project) } + it { is_expected.to be_allowed_for(:guest).of(project) } + it { is_expected.to be_allowed_for(:user) } + it { is_expected.to be_denied_for(:external) } + it { is_expected.to be_denied_for(:visitor) } + end + describe "GET /:project_path/environments" do subject { namespace_project_environments_path(project.namespace, project) } diff --git a/spec/features/security/project/private_access_spec.rb b/spec/features/security/project/private_access_spec.rb index 699ca4f724c..a66f6e09055 100644 --- a/spec/features/security/project/private_access_spec.rb +++ b/spec/features/security/project/private_access_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe "Private Project Access", feature: true do include AccessMatchers - let(:project) { create(:project, :private, public_builds: false) } + set(:project) { create(:project, :private, public_builds: false) } describe "Project should be private" do describe '#private?' do @@ -478,6 +478,48 @@ describe "Private Project Access", feature: true do it { is_expected.to be_denied_for(:visitor) } end + describe "GET /:project_path/pipeline_schedules" do + subject { namespace_project_pipeline_schedules_path(project.namespace, project) } + + it { is_expected.to be_allowed_for(:admin) } + it { is_expected.to be_allowed_for(:owner).of(project) } + it { is_expected.to be_allowed_for(:master).of(project) } + it { is_expected.to be_allowed_for(:developer).of(project) } + it { is_expected.to be_allowed_for(:reporter).of(project) } + it { is_expected.to be_denied_for(:guest).of(project) } + it { is_expected.to be_denied_for(:user) } + it { is_expected.to be_denied_for(:external) } + it { is_expected.to be_denied_for(:visitor) } + end + + describe "GET /:project_path/pipeline_schedules/new" do + subject { new_namespace_project_pipeline_schedule_path(project.namespace, project) } + + it { is_expected.to be_allowed_for(:admin) } + it { is_expected.to be_allowed_for(:owner).of(project) } + it { is_expected.to be_allowed_for(:master).of(project) } + it { is_expected.to be_allowed_for(:developer).of(project) } + it { is_expected.to be_denied_for(:reporter).of(project) } + it { is_expected.to be_denied_for(:guest).of(project) } + it { is_expected.to be_denied_for(:user) } + it { is_expected.to be_denied_for(:external) } + it { is_expected.to be_denied_for(:visitor) } + end + + describe "GET /:project_path/environments/new" do + subject { new_namespace_project_pipeline_schedule_path(project.namespace, project) } + + it { is_expected.to be_allowed_for(:admin) } + it { is_expected.to be_allowed_for(:owner).of(project) } + it { is_expected.to be_allowed_for(:master).of(project) } + it { is_expected.to be_allowed_for(:developer).of(project) } + it { is_expected.to be_denied_for(:reporter).of(project) } + it { is_expected.to be_denied_for(:guest).of(project) } + it { is_expected.to be_denied_for(:user) } + it { is_expected.to be_denied_for(:external) } + it { is_expected.to be_denied_for(:visitor) } + end + describe "GET /:project_path/container_registry" do let(:container_repository) { create(:container_repository) } diff --git a/spec/features/security/project/public_access_spec.rb b/spec/features/security/project/public_access_spec.rb index 624f0d0f485..5cd575500c3 100644 --- a/spec/features/security/project/public_access_spec.rb +++ b/spec/features/security/project/public_access_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe "Public Project Access", feature: true do include AccessMatchers - let(:project) { create(:project, :public) } + set(:project) { create(:project, :public) } describe "Project should be public" do describe '#public?' do @@ -257,6 +257,20 @@ describe "Public Project Access", feature: true do end end + describe "GET /:project_path/pipeline_schedules" do + subject { namespace_project_pipeline_schedules_path(project.namespace, project) } + + it { is_expected.to be_allowed_for(:admin) } + it { is_expected.to be_allowed_for(:owner).of(project) } + it { is_expected.to be_allowed_for(:master).of(project) } + it { is_expected.to be_allowed_for(:developer).of(project) } + it { is_expected.to be_allowed_for(:reporter).of(project) } + it { is_expected.to be_allowed_for(:guest).of(project) } + it { is_expected.to be_allowed_for(:user) } + it { is_expected.to be_allowed_for(:external) } + it { is_expected.to be_allowed_for(:visitor) } + end + describe "GET /:project_path/environments" do subject { namespace_project_environments_path(project.namespace, project) } |