use let instead of before hook
This commit is contained in:
parent
211a657b91
commit
f7791ab7e3
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue