Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2018-04-06 00:04:42 +0300
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-04-06 00:04:42 +0300
commitd54cf868f81ca957c8322661b11e6755d9ea5a85 (patch)
tree39ef104a65a13fc41a5fcc3a79b9e1ec9c154d3d /spec/serializers/job_entity_spec.rb
parentdd271e246001a06609592eef109d154291305d32 (diff)
Resolve "Show `failure_reason` and upgrade tooltips of jobs"
Diffstat (limited to 'spec/serializers/job_entity_spec.rb')
-rw-r--r--spec/serializers/job_entity_spec.rb26
1 files changed, 24 insertions, 2 deletions
diff --git a/spec/serializers/job_entity_spec.rb b/spec/serializers/job_entity_spec.rb
index 026360e91a3..24a6f1a2a8a 100644
--- a/spec/serializers/job_entity_spec.rb
+++ b/spec/serializers/job_entity_spec.rb
@@ -38,7 +38,7 @@ describe JobEntity do
it 'contains details' do
expect(subject).to include :status
- expect(subject[:status]).to include :icon, :favicon, :text, :label
+ expect(subject[:status]).to include :icon, :favicon, :text, :label, :tooltip
end
context 'when job is retryable' do
@@ -126,7 +126,29 @@ describe JobEntity do
it 'contains details' do
expect(subject).to include :status
- expect(subject[:status]).to include :icon, :favicon, :text, :label
+ expect(subject[:status]).to include :icon, :favicon, :text, :label, :tooltip
+ end
+ end
+
+ context 'when job failed' do
+ let(:job) { create(:ci_build, :script_failure) }
+
+ describe 'status' do
+ it 'should contain the failure reason inside label' do
+ expect(subject[:status]).to include :icon, :favicon, :text, :label, :tooltip
+ expect(subject[:status][:label]).to eq('failed')
+ expect(subject[:status][:tooltip]).to eq('failed <br> (script failure)')
+ end
+ end
+ end
+
+ context 'when job passed' do
+ let(:job) { create(:ci_build, :success) }
+
+ describe 'status' do
+ it 'should not contain the failure reason inside label' do
+ expect(subject[:status][:label]).to eq('passed')
+ end
end
end
end