diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-03-22 18:11:33 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-03-22 18:11:33 +0300 |
commit | 2829fa9a7b19eadf60b5e226dbc5ec48fddec492 (patch) | |
tree | 5d952801a5715e4f60a05382efbbc34b07f88b8d /spec/models/ci/pipeline_spec.rb | |
parent | f45358db311f76d9a3aa8c68dd1f503228691ae1 (diff) |
Add specs for extracted pipeline-related methods
Diffstat (limited to 'spec/models/ci/pipeline_spec.rb')
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 391a335d909..92f00cfbc19 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -177,6 +177,24 @@ describe Ci::Pipeline, :mailer do end end + describe '#protected_ref?' do + it 'delegates method to project' do + expect(pipeline).not_to be_protected_ref + end + end + + describe '#legacy_trigger' do + let(:trigger_request) { create(:ci_trigger_request) } + + before do + pipeline.trigger_requests << trigger_request + end + + it 'returns first trigger request' do + expect(pipeline.legacy_trigger).to eq trigger_request + end + end + describe '#auto_canceled?' do subject { pipeline.auto_canceled? } |