David Chelimsky wrote:
> It really depends on how deep the helper is reaching into the model.
> Ideally, when you're stubbing a layer, you want to be able to stub one
> thing. In this example, there are many things that need to be stubbed. A
> common example is a display formatter for a person's name:
>
> it "concats the first and last name" do
> person = double('person', :first_name => "Joe", :last_name => "Smith")
> helper.full_name_for(person).should == "Joe Smith"
> end
>
> Here we're just stubbing a couple of values on one object - simple. In
> this case it makes sense to just stub the model.
Thanks again David.
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users