Sha256: a55fd83cfa8606f7f270d0b44a12b1bda848f4a3ec74735035026c18011093d1

Contents?: true

Size: 772 Bytes

Versions: 4

Compression:

Stored size: 772 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

RSpec.describe Attachy::Viewer, '.content_options' do
  subject { described_class.new method, object, options }

  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

  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

4 entries across 4 versions & 1 rubygems

Version Path
attachy-0.4.1 spec/models/attachy/viewer/content_options_spec.rb
attachy-0.4.0 spec/models/attachy/viewer/content_options_spec.rb
attachy-0.3.0 spec/models/attachy/viewer/content_options_spec.rb
attachy-0.2.0 spec/models/attachy/viewer/content_options_spec.rb