Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Fletcher <mark@gitlab.com>2017-07-20 13:54:36 +0300
committerMark Fletcher <mark@gitlab.com>2018-02-01 20:25:13 +0300
commit391d1915c8a9e6f723594a6f4930dcd90fe1bc1a (patch)
tree62b59142e4275d527f35e44cae73154823b4a24f /spec/policies
parent5b73e0eb35f5b9b78c228a4867ef78538ef05653 (diff)
Hide pipeline schedule 'take ownership' for current owner
Diffstat (limited to 'spec/policies')
-rw-r--r--spec/policies/ci/pipeline_schedule_policy_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/policies/ci/pipeline_schedule_policy_spec.rb b/spec/policies/ci/pipeline_schedule_policy_spec.rb
index 1b0e9fac355..c0c3eda4911 100644
--- a/spec/policies/ci/pipeline_schedule_policy_spec.rb
+++ b/spec/policies/ci/pipeline_schedule_policy_spec.rb
@@ -88,5 +88,19 @@ describe Ci::PipelineSchedulePolicy, :models do
expect(policy).to be_allowed :admin_pipeline_schedule
end
end
+
+ describe 'rules for non-owner of schedule' do
+ let(:owner) { create(:user) }
+
+ before do
+ project.add_master(owner)
+ project.add_master(user)
+ pipeline_schedule.update(owner: owner)
+ end
+
+ it 'includes abilities to take ownership' do
+ expect(policy).to be_allowed :take_ownership_pipeline_schedule
+ end
+ end
end
end