Sha256: 75a91a25584c398fe8798869f931b9c404b92f4fd0addf727e85feedd680c1ec

Contents?: true

Size: 610 Bytes

Versions: 4

Compression:

Stored size: 610 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

class DummyHelper
  include Attachy::ViewHelper
end

RSpec.describe DummyHelper, '.attachy_file_field' do
  let!(:method)  { :avatar }
  let!(:options) { { key: :value } }
  let!(:object)  { create :user }
  let!(:helper)  { DummyHelper.new }
  let!(:viewer)  { double Attachy::Viewer, file_field: :file_field }

  before do
    allow(Attachy::Viewer).to receive(:new).with(method, object, options, helper) { viewer }
  end

  it 'calls file_field from viewer' do
    expect(helper.attachy_file_field(method, object, options)).to eq :file_field
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
attachy-0.4.1 spec/helpers/attachy/attachy_file_field_spec.rb
attachy-0.4.0 spec/helpers/attachy/attachy_file_field_spec.rb
attachy-0.3.0 spec/helpers/attachy/attachy_file_field_spec.rb
attachy-0.2.0 spec/helpers/attachy/attachy_file_field_spec.rb