Commit 1a051228 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '341900-fix-issue-finder-params-on-export' into 'master'

Fix issue and MR exports to support NOT filters

See merge request gitlab-org/gitlab!74764
parents 6faf3101 cc00ac7f
......@@ -41,7 +41,7 @@ class IssuableExportCsvWorker # rubocop:disable Scalability/IdempotentWorker
def parse_params(params, project_id)
params
.symbolize_keys
.with_indifferent_access
.except(:sort)
.merge(project_id: project_id)
end
......
......@@ -35,10 +35,15 @@ RSpec.describe IssuableExportCsvWorker do
end
context 'with params' do
let(:params) { { 'test_key' => true } }
let(:params) { { 'test_key' => true, 'not' => { 'label_name' => ['SomeLabel'] } } }
it 'converts controller string keys to symbol keys for IssuesFinder' do
expect(IssuesFinder).to receive(:new).with(user, hash_including(test_key: true)).and_call_original
it 'allows symbol access for IssuesFinder' do
expect(IssuesFinder).to receive(:new).and_wrap_original do |method, user, params|
expect(params[:test_key]).to eq(true)
expect(params[:not][:label_name]).to eq(['SomeLabel'])
method.call(user, params)
end
subject
end
......
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