Skip to content

Commit

Permalink
use let instead of before hook
Browse files Browse the repository at this point in the history
  • Loading branch information
nashby authored and steveklabnik committed Mar 25, 2012
1 parent 211a657 commit f7791ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/draper/helper_support_spec.rb
@@ -1,16 +1,16 @@
require 'spec_helper'

describe Draper::HelperSupport do
before(:each){ @product = Product.new}
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
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.decorate(product){|p| p.model.object_id }
ApplicationController.capture_triggered.should be
end
end
Expand Down

0 comments on commit f7791ab

Please sign in to comment.