From 6113ff992c9a494ea8c657f20fa92f7f7f2365c4 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Tue, 30 May 2017 13:27:46 +0200 Subject: Expose stage model attributes from pipeline object --- spec/models/ci/pipeline_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'spec/models') diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 56b24ce62f3..c4f07c4a693 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -502,6 +502,20 @@ describe Ci::Pipeline, models: true do end end + describe '#has_stages?' do + context 'when pipeline has stages' do + subject { create(:ci_pipeline_with_one_job) } + + it { is_expected.to have_stages } + end + + context 'when pipeline does not have stages' do + subject { create(:ci_pipeline_without_jobs) } + + it { is_expected.not_to have_stages } + end + end + describe '#has_warnings?' do subject { pipeline.has_warnings? } -- cgit v1.2.1