Sha256: cc1d510933b868f363986ccd1f3a9368729a0162926e9a456827cf64d5a670b9

Contents?: true

Size: 481 Bytes

Versions: 10

Compression:

Stored size: 481 Bytes

Contents

require 'spec_helper'

describe Draper::HelperSupport do
  let(: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

10 entries across 10 versions & 1 rubygems

Version Path
draper-0.17.0 spec/draper/helper_support_spec.rb
draper-0.16.0 spec/draper/helper_support_spec.rb
draper-0.15.0 spec/draper/helper_support_spec.rb
draper-0.15.0rc1 spec/draper/helper_support_spec.rb
draper-0.14.0 spec/draper/helper_support_spec.rb
draper-0.12.3 spec/draper/helper_support_spec.rb
draper-0.12.2 spec/draper/helper_support_spec.rb
draper-0.13.0 spec/draper/helper_support_spec.rb
draper-0.12.1 spec/draper/helper_support_spec.rb
draper-0.12.0 spec/draper/helper_support_spec.rb