Sha256: e7b27e03ce3822a83d725ae06903c6680909b29e59e39f6df6d2fa8a2cb4d43f
Contents?: true
Size: 635 Bytes
Versions: 39
Compression:
Stored size: 635 Bytes
Contents
require 'rails_helper' describe 'representations controller' do let(:file) { File.open("#{PgEngine::Engine.root}/spec/fixtures/test.pdf") } it do categoria = create :categoria_de_cosa categoria.file.attach(io: file, filename: 'test.pdf') path = polymorphic_url(categoria.file.preview(:thumb), only_path: true) expect(path).to start_with '/rails/active_storage/representations/redirect/' get path ActiveStorage::Current.url_options = { host: 'www.example.com' } expect(response).to have_http_status(:redirect) expect(response.headers['location']).to include '/rails/active_storage/disk/' end end
Version data entries
39 entries across 39 versions & 1 rubygems