diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-01-27 15:02:59 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-01-27 15:02:59 +0300 |
commit | 42e3f0fd7888ab8ebe11801e01dd3ca1f33b20cf (patch) | |
tree | 9840de93c579b1a6422144a0352493d45f6978bb /spec/serializers/analytics_stage_serializer_spec.rb | |
parent | 256a7735f8cb8872a7f7595590300e2fd952428e (diff) |
Return serializable hash from a represented serializer
Diffstat (limited to 'spec/serializers/analytics_stage_serializer_spec.rb')
-rw-r--r-- | spec/serializers/analytics_stage_serializer_spec.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/serializers/analytics_stage_serializer_spec.rb b/spec/serializers/analytics_stage_serializer_spec.rb index f9951826683..be6aa7c65c3 100644 --- a/spec/serializers/analytics_stage_serializer_spec.rb +++ b/spec/serializers/analytics_stage_serializer_spec.rb @@ -1,13 +1,13 @@ require 'spec_helper' describe AnalyticsStageSerializer do - let(:serializer) do - described_class - .new.represent(resource) + subject do + described_class.new.represent(resource) end - let(:json) { serializer.as_json } - let(:resource) { Gitlab::CycleAnalytics::CodeStage.new(project: double, options: {}) } + let(:resource) do + Gitlab::CycleAnalytics::CodeStage.new(project: double, options: {}) + end before do allow_any_instance_of(Gitlab::CycleAnalytics::BaseStage).to receive(:median).and_return(1.12) @@ -15,10 +15,10 @@ describe AnalyticsStageSerializer do end it 'it generates payload for single object' do - expect(json).to be_kind_of Hash + expect(subject).to be_kind_of Hash end it 'contains important elements of AnalyticsStage' do - expect(json).to include(:title, :description, :value) + expect(subject).to include(:title, :description, :value) end end |