Home > Enterprise >  Why response.body not readable with xlsx format
Why response.body not readable with xlsx format

Time:12-24

I want to add the RSpec test for our exporting file with the xlsx file but after getting the index of the end-point with xlsx format, my response.body is not readable and I can't check file contents

rspec:

it 'returns a successful 200 response for xlsx format' do
  get :index, format: :json

  expect(response).to be_successful
  expect(response.headers['Content-Type']).to eq('my_value'; charset=utf-8')
  expect(response.request.fullpath).to eq('end_poing_path.xlsx')
end

but when I want to check response.body I got bellow picture

response.body

CodePudding user response:

I used caxlsx gem and it's can't read Excel files, so I had to install another gem (enter image description here

  • Related