From 5bfabeca4acd9bdf7d3e7c2cc1aa631ed84908dc Mon Sep 17 00:00:00 2001 From: Yi Wen Date: Fri, 27 Jul 2012 10:10:13 -0500 Subject: [PATCH] To make the spec support smarter You do not have to specify forwarded attributes in the model double --- spec/support/macros/forward_from_model.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/support/macros/forward_from_model.rb b/spec/support/macros/forward_from_model.rb index 37f3b27..5f67a94 100644 --- a/spec/support/macros/forward_from_model.rb +++ b/spec/support/macros/forward_from_model.rb @@ -5,6 +5,7 @@ def forward_from_model_attributes(*attributes) attributes.each do |attribute| describe "##{attribute}" do it "returns the model.#{attribute}" do + model.stub(attribute).and_return(attribute) result = subject.send(attribute) if result.respond_to?(:should) result.should eq(model.send(attribute))