Sha256: 989a78894007dc8703c91fae07dabc3d5e4515bf35daaf0c70c76f48ce73ebab
Contents?: true
Size: 859 Bytes
Versions: 3
Compression:
Stored size: 859 Bytes
Contents
require 'rails_helper' class Dummy < ActionView::Helpers::FormBuilder include Attachy::FormBuilder end class DummyHelper include Attachy::ViewHelper end RSpec.describe Dummy, '.attachy' 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 it 'delegates to view helper' do expect(template).to receive(:attachy).with(method, object, options, nil) dummy.attachy method, options end end context 'with block' do let!(:block) { proc {} } it 'delegates to view helper with block' do expect(template).to receive(:attachy).with(method, object, options, block) dummy.attachy method, options, &block end end end
Version data entries
3 entries across 3 versions & 1 rubygems