summaryrefslogtreecommitdiff
path: root/spec/models/ci
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-11-06 23:24:25 +0900
committerShinya Maeda <shinya@gitlab.com>2017-11-06 23:24:25 +0900
commitc8eb2a914b6f9348ffa16436853964998c115085 (patch)
tree0c2ba6aa3a7d664663e4af0e571e9d4a7ddda2ac /spec/models/ci
parent9b58b8e363fd388635385085c58be3d4637eaa45 (diff)
downloadgitlab-ce-c8eb2a914b6f9348ffa16436853964998c115085.tar.gz
Fix spec. Revert update check.
Diffstat (limited to 'spec/models/ci')
-rw-r--r--spec/models/ci/build_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index 5ed2e1ca99a..88f7b1775a0 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -270,6 +270,23 @@ describe Ci::Build do
end
end
+ describe '#owned_by?' do
+ subject { build.owned_by?(user) }
+
+ context 'when user is owner' do
+ let(:build) { create(:ci_build, pipeline: pipeline, user: user) }
+
+ it { is_expected.to be_truthy }
+ end
+
+ context 'when user is not owner' do
+ let(:another_user) { create(:user) }
+ let(:build) { create(:ci_build, pipeline: pipeline, user: another_user) }
+
+ it { is_expected.to be_falsy }
+ end
+ end
+
describe '#detailed_status' do
it 'returns a detailed status' do
expect(build.detailed_status(user))