Sha256: ad432a6b77984dbc1298f74f1d661e25ec5933681f75497980ba89444115d6c2
Contents?: true
Size: 979 Bytes
Versions: 3
Compression:
Stored size: 979 Bytes
Contents
require 'spec_helper' RSpec.describe QuickbooksWebConnector::QwcController, type: :controller do routes { QuickbooksWebConnector::Engine.routes } describe 'GET :download' do it 'renders the QWC file' do QuickbooksWebConnector.config.user 'jane', 'password', '/path/to/company.qbw' get :download, params: { username: 'jane', format: :xml } expect(response).to be_success expect(response.header['Content-Type']).to match(/application\/xml/) expect(response.header['Content-Disposition']).to match(/attachment/) expect(response.header['Content-Disposition']).to match(/jane\.qwc/) expect(response).to render_template(:qwc) expect(assigns(:user).username).to eq('jane') end it 'returns a 404 when no user matches the given username' do get :download, params: { username: 'jane', format: :xml } expect(response.code).to eq('404') expect(response).to_not render_template(:qwc) end end end
Version data entries
3 entries across 3 versions & 1 rubygems