From 830f739b99b36f8862dadc524e4aa72ec5a3366e Mon Sep 17 00:00:00 2001 From: James Lopez Date: Fri, 25 Nov 2016 11:22:44 +0100 Subject: use an empty total time when the build has not started yet so the UI knows --- spec/serializers/analytics_build_entity_spec.rb | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'spec/serializers') diff --git a/spec/serializers/analytics_build_entity_spec.rb b/spec/serializers/analytics_build_entity_spec.rb index ba562353661..1a9ad1968bd 100644 --- a/spec/serializers/analytics_build_entity_spec.rb +++ b/spec/serializers/analytics_build_entity_spec.rb @@ -42,7 +42,13 @@ describe AnalyticsBuildEntity do expect{ subject[:date] }.not_to raise_error end - it '' + it 'shows the right message' do + expect(subject[:date]).to eq('Not started') + end + + it 'shows the right total time' do + expect(subject[:total_time]).to eq({}) + end end context 'no started at date' do @@ -51,6 +57,14 @@ describe AnalyticsBuildEntity do it 'does not blow up' do expect{ subject[:date] }.not_to raise_error end + + it 'shows the right message' do + expect(subject[:date]).to eq('Not started') + end + + it 'shows the right total time' do + expect(subject[:total_time]).to eq({}) + end end context 'no finished at date' do @@ -59,6 +73,14 @@ describe AnalyticsBuildEntity do it 'does not blow up' do expect{ subject[:date] }.not_to raise_error end + + it 'shows the right message' do + expect(subject[:date]).to eq('about 2 hours ago') + end + + it 'shows the right total time' do + expect(subject[:total_time]).to eq({hours: 2}) + end end end end -- cgit v1.2.1