Sha256: 981a6d7ee0547e11272df289241022ae84c01c3c687df90daed166db92c21dab

Contents?: true

Size: 683 Bytes

Versions: 2

Compression:

Stored size: 683 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

RSpec.describe Attachy::File, '#default' do
  before do
    allow(::Rails).to receive_message_chain(:application, :config_for).with(:attachy) do
      {
        'default' => {
          'image' => {
            'public_id' => 'default',
            'format'    => 'png',
            'version'   => 1
          }
        }
      }
    end
  end

  it 'returns a new file object with the config values' do
    default = described_class.default

    expect(default).to           be_new_record
    expect(default.format).to    eq 'png'
    expect(default.public_id).to eq 'default'
    expect(default.version).to   eq '1'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
attachy-0.3.0 spec/models/attachy/file/default_spec.rb
attachy-0.2.0 spec/models/attachy/file/default_spec.rb