Sha256: 8adb47ffc21eeaa677aaf0ed3b6c87877aa8fff3c459c765e717cf4ac5c73122

Contents?: true

Size: 561 Bytes

Versions: 3

Compression:

Stored size: 561 Bytes

Contents

require 'rails_helper'

class DummyHelper
  include Attachy::ViewHelper
end

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

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

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