Commit cc00ac7f authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Fix issue and MR exports to support NOT filters

This fixes the params passed in to the finders so that nested params can
be accessed using symbols.

Changelog: fixed
parent 0d360b01
......@@ -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