summaryrefslogtreecommitdiff
path: root/spec/policies
diff options
context:
space:
mode:
authorMark Fletcher <mark@gitlab.com>2017-07-20 17:54:36 +0700
committerMark Fletcher <mark@gitlab.com>2018-02-01 17:25:13 +0000
commit391d1915c8a9e6f723594a6f4930dcd90fe1bc1a (patch)
tree62b59142e4275d527f35e44cae73154823b4a24f /spec/policies
parent5b73e0eb35f5b9b78c228a4867ef78538ef05653 (diff)
downloadgitlab-ce-391d1915c8a9e6f723594a6f4930dcd90fe1bc1a.tar.gz
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