|
|
@ -178,9 +178,11 @@ describe WorkPackagesController, type: :controller do |
|
|
|
expect(WorkPackage::Exporter).to receive(:csv).with(work_packages, query) |
|
|
|
expect(WorkPackage::Exporter).to receive(:csv).with(work_packages, query) |
|
|
|
.and_return(mock_csv) |
|
|
|
.and_return(mock_csv) |
|
|
|
|
|
|
|
|
|
|
|
expect(controller).to receive(:send_data).with(mock_csv, |
|
|
|
expect(controller) |
|
|
|
type: 'text/csv; charset=utf-8; header=present', |
|
|
|
.to receive(:send_data) |
|
|
|
filename: "#{query.name}.csv") do |_| |
|
|
|
.with(mock_csv.to_s, |
|
|
|
|
|
|
|
type: 'text/csv; header=present; charset=utf-8;', |
|
|
|
|
|
|
|
disposition: "attachment; filename=#{query.name}.csv") do |_| |
|
|
|
# We need to render something because otherwise |
|
|
|
# We need to render something because otherwise |
|
|
|
# the controller will and he will not find a suitable template |
|
|
|
# the controller will and he will not find a suitable template |
|
|
|
controller.render text: 'success' |
|
|
|
controller.render text: 'success' |
|
|
|