Sha256: cbf902fb11e40edf18e244cd3d90500b2a888367b133c13cc615e7cdd206295e

Contents?: true

Size: 498 Bytes

Versions: 2

Compression:

Stored size: 498 Bytes

Contents

require 'spec_helper'

describe Draper::HelperSupport do
  before(:each){ @product = Product.new}

  context '#decorate' do
    it 'renders a block' do
      output = ApplicationController.decorate(@product){|p| p.model.object_id }
      output.should == @product.object_id
    end
    
    it 'uses #capture so Rails only renders the content once' do
      ApplicationController.decorate(@product){|p| p.model.object_id }
      ApplicationController.capture_triggered.should be
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
draper-0.10.0 spec/draper/helper_support_spec.rb
draper-0.9.5 spec/draper/helper_support_spec.rb