diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-11-06 23:24:25 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-11-06 23:24:25 +0900 |
commit | c8eb2a914b6f9348ffa16436853964998c115085 (patch) | |
tree | 0c2ba6aa3a7d664663e4af0e571e9d4a7ddda2ac /spec/policies | |
parent | 9b58b8e363fd388635385085c58be3d4637eaa45 (diff) | |
download | gitlab-ce-c8eb2a914b6f9348ffa16436853964998c115085.tar.gz |
Fix spec. Revert update check.
Diffstat (limited to 'spec/policies')
-rw-r--r-- | spec/policies/ci/build_policy_spec.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/spec/policies/ci/build_policy_spec.rb b/spec/policies/ci/build_policy_spec.rb index e5d5e1017cd..d8e73e4a890 100644 --- a/spec/policies/ci/build_policy_spec.rb +++ b/spec/policies/ci/build_policy_spec.rb @@ -151,10 +151,9 @@ describe Ci::BuildPolicy do end end - # TODO: Finish spec describe 'rules for erase build' do let(:project) { create(:project, :repository) } - let(:another_user) { create(:user) } + let(:build) { create(:ci_build, pipeline: pipeline, user: owner) } context 'when developer created a build' do before do @@ -162,13 +161,13 @@ describe Ci::BuildPolicy do end context 'when the build was created by the user' do - let(:build) { create(:ci_build, user: user) } + let(:owner) { user } it { expect(policy).to be_allowed :erase_build } end context 'when the build was created by others' do - let(:build) { create(:ci_build, user: another_user) } + let(:owner) { create(:user) } it { expect(policy).to be_disallowed :erase_build } end @@ -180,13 +179,13 @@ describe Ci::BuildPolicy do end context 'when the build was created by the user' do - let(:build) { create(:ci_build, user: user) } + let(:owner) { user } it { expect(policy).to be_allowed :erase_build } end context 'when the build was created by others' do - let(:build) { create(:ci_build, user: another_user) } + let(:owner) { create(:user) } it { expect(policy).to be_allowed :erase_build } end |