summaryrefslogtreecommitdiff
path: root/spec/serializers/analytics_build_entity_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/serializers/analytics_build_entity_spec.rb')
-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