Sha256: 6fa3d806c5fa9e156db6e65cc4864cea5eb361961e26b4a9ea450ed5f7bd5003

Contents?: true

Size: 582 Bytes

Versions: 1

Compression:

Stored size: 582 Bytes

Contents

require 'spec_helper'
require 'support/view_helper'


describe ActionPresenter::ViewHelper do
  let(:helper) { DummyActionController.send(:include, ActionPresenter::ViewHelper).new }

  it 'should call default presenter if presenter class is not given' do
    helper.present('foobar') do |p|
      p.foobar
    end.should == 'foo'
  end

  it 'should call given presenter class' do
    helper.present('foobar', FoobarPresenter) do |p|
      p.foobar
    end.should == 'bar'
  end

  it 'should return nil if no block is given' do
    helper.present('foobar').should be_nil
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
action_presenter-1.0 spec/action_presenter/view_helper_spec.rb