Sha256: 360b922c2260090e7d6d47903b1634ac721ef10ee65306aacfd77b0e55376cf7

Contents?: true

Size: 901 Bytes

Versions: 3

Compression:

Stored size: 901 Bytes

Contents

require 'rails_helper'

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

class DummyHelper
  include Attachy::ViewHelper
end

RSpec.describe Dummy, '.attachy_content' 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 }

  context 'with no block' do
    xit 'delegates to view helper' do
      expect(template).to receive(:attachy_content).with(method, object, options, nil)

      dummy.attachy_content method, options
    end
  end

  context 'with block' do
    let!(:block) { proc {} }

    xit 'delegates to view helper with block' do
      expect(template).to receive(:attachy_content).with(method, object, options, block)

      dummy.attachy_content method, options, &block
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
attachy-0.1.2 spec/builders/attachy/form_builder/attachy_content_spec.rb
attachy-0.1.1 spec/builders/attachy/form_builder/attachy_content_spec.rb
attachy-0.1.0 spec/builders/attachy/form_builder/attachy_content_spec.rb