Commit 697904d9 authored by Eugenia Grieff's avatar Eugenia Grieff

Convert issuable type to symbol before comparing

- The issuable type argument can be a string so it
shouldn't be compare with a symbol before
converting it first
parent a6a354d8
......@@ -11,7 +11,7 @@ module EE
override :export_service
def export_service(type, user, project, params)
return super unless type == :requirement
return super unless type.to_sym == :requirement
fields = params.with_indifferent_access.delete(:selected_fields) || []
issuable_classes = issuable_classes_for(type.to_sym)
......@@ -21,7 +21,7 @@ module EE
override :issuable_classes_for
def issuable_classes_for(type)
return super unless type == :requirement
return super unless type.to_sym == :requirement
{ finder: ::RequirementsManagement::RequirementsFinder, service: ::RequirementsManagement::ExportCsvService }
end
......
......@@ -10,7 +10,7 @@ RSpec.describe IssuableExportCsvWorker do
subject { described_class.new.perform(issuable_type, user.id, project.id, params) }
context 'when issuable type is :requirement' do
let(:issuable_type) { :requirement }
let(:issuable_type) { 'requirement' }
it 'emails a CSV' do
expect { subject }.to change(ActionMailer::Base.deliveries, :size).by(1)
......
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