summaryrefslogtreecommitdiff
path: root/spec/presenters/ci/pipeline_presenter_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-14 18:07:40 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-14 18:07:40 +0000
commitd5e16807136445884fd7cc5f71f9f039f823b5d8 (patch)
treea3e60aa59ac9a83966c7ecda6d8bb9a89adc1fbc /spec/presenters/ci/pipeline_presenter_spec.rb
parent016af097cb1fa872fdc28a786d16315e55cd2701 (diff)
downloadgitlab-ce-d5e16807136445884fd7cc5f71f9f039f823b5d8.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/presenters/ci/pipeline_presenter_spec.rb')
-rw-r--r--spec/presenters/ci/pipeline_presenter_spec.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/spec/presenters/ci/pipeline_presenter_spec.rb b/spec/presenters/ci/pipeline_presenter_spec.rb
index eca5d3e05fe..fd391478eb4 100644
--- a/spec/presenters/ci/pipeline_presenter_spec.rb
+++ b/spec/presenters/ci/pipeline_presenter_spec.rb
@@ -62,13 +62,19 @@ describe Ci::PipelinePresenter do
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
+ describe '#failure_reason' do
+ context 'when pipeline has a failure reason' do
+ ::Ci::PipelineEnums.failure_reasons.keys.each do |failure_reason|
+ context "when failure reason is #{failure_reason}" do
+ before do
+ pipeline.failure_reason = failure_reason
+ end
- expect(presenter.failure_reason)
- .to eq 'CI/CD YAML configuration error!'
+ it 'represents a failure reason sentence' do
+ expect(presenter.failure_reason).to be_an_instance_of(String)
+ expect(presenter.failure_reason).not_to eq(failure_reason.to_s)
+ end
+ end
end
end