Sha256: d233f881a18a5bc2545a1a72fae7bd4dc72efabfdb620bbbd91c06bf92e247e8
Contents?: true
Size: 1.6 KB
Versions: 7
Compression:
Stored size: 1.6 KB
Contents
require 'spec_helper' module Pageflow module Chart describe Configuration do describe 'paperclip_options' do it 'returns hash with path option for file with given extension' do configuration = Configuration.new result = configuration.paperclip_options(extension: 'js') expect(result[:path]).to eq(':pageflow_s3_root/:class/:id_partition/all.js') end it 'allows to override basename of path option' do configuration = Configuration.new result = configuration.paperclip_options(basename: 'some', extension: 'js') expect(result[:path]).to eq(':pageflow_s3_root/:class/:id_partition/some.js') end it 'uses paperclip_base_path as prefix' do configuration = Configuration.new configuration.paperclip_base_path = 'main' result = configuration.paperclip_options(basename: 'some', extension: 'js') expect(result[:path]).to eq('main/:class/:id_partition/some.js') end it 'returns hash with s3_headers option with matching content type for js' do configuration = Configuration.new result = configuration.paperclip_options(extension: 'js') expect(result[:s3_headers]['Content-Type']).to eq('application/javascript') end it 'returns hash with s3_headers option with matching content type for css' do configuration = Configuration.new result = configuration.paperclip_options(extension: 'css') expect(result[:s3_headers]['Content-Type']).to eq('text/css') end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems