summaryrefslogtreecommitdiff
path: root/spec/serializers
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-11-25 11:22:44 +0100
committerJames Lopez <james@jameslopez.es>2016-11-25 11:47:33 +0100
commit830f739b99b36f8862dadc524e4aa72ec5a3366e (patch)
tree744f10d8900493e2443b36d432cd6ed0f5e76f24 /spec/serializers
parentaa895a64d928f8292ff9df526831ae74d250f748 (diff)
downloadgitlab-ce-830f739b99b36f8862dadc524e4aa72ec5a3366e.tar.gz
use an empty total time when the build has not started yet so the UI knows
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/analytics_build_entity_spec.rb24
1 files changed, 23 insertions, 1 deletions
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