Sha256: 2b4afe1ea6d138432925e7d7dd68ef353a49c979dc52750f6bdc72e02242033e

Contents?: true

Size: 630 Bytes

Versions: 4

Compression:

Stored size: 630 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

class Dummy < ActionView::Helpers::FormBuilder
  include Attachy::FormBuilder
end

class DummyHelper
  include Attachy::ViewHelper
end

RSpec.describe Dummy, '.attachy_file_field' do
  let!(:method)   { :avatar }
  let!(:options)  { { key: :value } }
  let!(:object)   { create :user }
  let!(:template) { DummyHelper.new }
  let!(:dummy)    { described_class.new method, object, template, options }

  it 'delegates to view helper' do
    expect(template).to receive(:attachy_file_field).with(method, object, options)

    dummy.attachy_file_field method, options
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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