diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-08 15:09:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-08 15:09:42 +0300 |
commit | 403678e00406edc8094f087ec70e00aa29e49bef (patch) | |
tree | 447d6d4967e9a11895683b27e637a50bd9fc0602 /spec/serializers | |
parent | f5050253469fc0961c02deec0e698ad62bdd9de5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/analytics_summary_serializer_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/serializers/analytics_summary_serializer_spec.rb b/spec/serializers/analytics_summary_serializer_spec.rb index 06f2c0ca68b..7950f89bcc7 100644 --- a/spec/serializers/analytics_summary_serializer_spec.rb +++ b/spec/serializers/analytics_summary_serializer_spec.rb @@ -28,4 +28,18 @@ describe AnalyticsSummarySerializer do it 'contains important elements of AnalyticsStage' do expect(subject).to include(:title, :value) end + + it 'does not include unit' do + expect(subject).not_to include(:unit) + end + + context 'when representing with unit' do + let(:resource) { { title: 'frequency', value: 1.12, unit: 'per day' } } + + subject { described_class.new.represent(resource, with_unit: true) } + + it 'contains unit' do + expect(subject).to include(:unit) + end + end end |