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

Version Path
pg_rails-7.6.23 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.22 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.22.pre.3 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.22.pre.2 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.22.pre.1 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.21 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.21.pre.11 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.21.pre.10 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.21.pre.9 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.21.pre.8 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.21.pre.7 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.21.pre.6 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.21.pre.5 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.21.pre.4 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.21.pre.3 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.21.pre.2 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.21.pre.1 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.20 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.19 pg_engine/spec/requests/active_storage_spec.rb
pg_rails-7.6.18 pg_engine/spec/requests/active_storage_spec.rb