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/models/ci | |
parent | 9b58b8e363fd388635385085c58be3d4637eaa45 (diff) | |
download | gitlab-ce-c8eb2a914b6f9348ffa16436853964998c115085.tar.gz |
Fix spec. Revert update check.
Diffstat (limited to 'spec/models/ci')
-rw-r--r-- | spec/models/ci/build_spec.rb | 17 |
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)) |