Commit 72848f1e authored by Adam Hegyi's avatar Adam Hegyi

Fix passing date params in VSA Summary

parent 4065584b
...@@ -12,6 +12,8 @@ module EE ...@@ -12,6 +12,8 @@ module EE
options[:branch] = params[:branch_name] options[:branch] = params[:branch_name]
options[:projects] = params[:project_ids] if params[:project_ids] options[:projects] = params[:project_ids] if params[:project_ids]
options[:group] = params[:group_id] if params[:group_id] options[:group] = params[:group_id] if params[:group_id]
options[:from] = params[:from] if params[:from]
options[:to] = params[:to] if params[:to]
options.merge!(params.slice(*::Gitlab::Analytics::CycleAnalytics::RequestParams::FINDER_PARAM_NAMES)) options.merge!(params.slice(*::Gitlab::Analytics::CycleAnalytics::RequestParams::FINDER_PARAM_NAMES))
end end
end end
......
---
title: Fix passing date params in VSA Summary request
merge_request: 35152
author:
type: fixed
...@@ -31,6 +31,17 @@ RSpec.describe Analytics::CycleAnalytics::SummaryController do ...@@ -31,6 +31,17 @@ RSpec.describe Analytics::CycleAnalytics::SummaryController do
subject { get :show, params: params } subject { get :show, params: params }
it_behaves_like 'summary endpoint' it_behaves_like 'summary endpoint'
it 'passes the date filter to the query class' do
expected_date_range = {
created_after: Date.parse(params[:created_after]).at_beginning_of_day,
created_before: Date.parse(params[:created_before]).at_end_of_day
}
expect(IssuesFinder).to receive(:new).with(user, hash_including(expected_date_range)).and_call_original
subject
end
end end
describe 'GET "time_summary"' do describe 'GET "time_summary"' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment