Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/analytics/cycle_analytics/aggregated/records_fetcher_spec.rb')
-rw-r--r--spec/lib/gitlab/analytics/cycle_analytics/aggregated/records_fetcher_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/lib/gitlab/analytics/cycle_analytics/aggregated/records_fetcher_spec.rb b/spec/lib/gitlab/analytics/cycle_analytics/aggregated/records_fetcher_spec.rb
index 8eb75feaa8d..7e36d89a2a1 100644
--- a/spec/lib/gitlab/analytics/cycle_analytics/aggregated/records_fetcher_spec.rb
+++ b/spec/lib/gitlab/analytics/cycle_analytics/aggregated/records_fetcher_spec.rb
@@ -27,6 +27,26 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::Aggregated::RecordsFetcher do
expect(returned_iids).to eq(expected_issue_ids)
end
+
+ it 'passes a hash with all expected attributes to the serializer' do
+ expected_attributes = [
+ 'created_at',
+ 'id',
+ 'iid',
+ 'title',
+ :end_event_timestamp,
+ :start_event_timestamp,
+ :total_time,
+ :author,
+ :namespace_path,
+ :project_path
+ ]
+ serializer = instance_double(records_fetcher.send(:serializer).class.name)
+ allow(records_fetcher).to receive(:serializer).and_return(serializer)
+ expect(serializer).to receive(:represent).at_least(:once).with(hash_including(*expected_attributes)).and_return({})
+
+ records_fetcher.serialized_records
+ end
end
describe '#serialized_records' do