Sha256: b34b2104db4ce5b3a7fec3e6265709c3361b061ee9f5606db72c73f145384265

Contents?: true

Size: 741 Bytes

Versions: 3

Compression:

Stored size: 741 Bytes

Contents

require 'rails_helper'

RSpec.describe Attachy::Viewer, '.content_options' do
  let!(:object)  { create :user }
  let!(:method)  { :avatar }
  let(:file)     { create :file, attachable: object, scope: method }
  let!(:options) { { t: { height: 600, width: 800 } } }

  before do
    allow(Cloudinary::Uploader).to receive(:remove_tag)

    allow(subject).to receive(:metadata) { { crop: :crop, multiple: :multiple } }
  end

  subject { described_class.new method, object, options }

  it 'returns the default field options' do
    expect(subject.content_options).to eq(
      class: :attachy__content,

      data: {
        crop:     :crop,
        height:   600,
        multiple: :multiple,
        width:    800
      }
    )
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
attachy-0.1.2 spec/models/attachy/viewer/content_options_spec.rb
attachy-0.1.1 spec/models/attachy/viewer/content_options_spec.rb
attachy-0.1.0 spec/models/attachy/viewer/content_options_spec.rb