diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-10-03 13:18:59 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-10-05 11:41:16 +0200 |
commit | 123da5fbe8f5dee13278b1ef9aff79ff9adcef90 (patch) | |
tree | 56699ba3c224a514458bb4f08580a866ebac4825 /spec/presenters | |
parent | ffce9fd53f4e7d400d6f45e00b7e59acd902f3a6 (diff) | |
download | gitlab-ce-123da5fbe8f5dee13278b1ef9aff79ff9adcef90.tar.gz |
Improve specs for pipeline failure reason presenter
Conflicts:
app/presenters/ci/pipeline_presenter.rb
Diffstat (limited to 'spec/presenters')
-rw-r--r-- | spec/presenters/ci/pipeline_presenter_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/presenters/ci/pipeline_presenter_spec.rb b/spec/presenters/ci/pipeline_presenter_spec.rb index e4886a8f019..f7ceaf844be 100644 --- a/spec/presenters/ci/pipeline_presenter_spec.rb +++ b/spec/presenters/ci/pipeline_presenter_spec.rb @@ -51,4 +51,21 @@ describe Ci::PipelinePresenter do end end end + + context '#failure_reason' do + context 'when pipeline has failure reason' do + it 'represents a failure reason sentence' do + pipeline.failure_reason = :config_error + + expect(presenter.failure_reason) + .to eq 'CI/CD YAML configuration error!' + end + end + + context 'when pipeline does not have failure reason' do + it 'returns nil' do + expect(presenter.failure_reason).to be_nil + end + end + end end |