search for: collection_model

Displaying 1 result from an estimated 1 matches for "collection_model".

2007 May 15
3
nested blocks
...would value any criticisms of my approach (i.e., defining it_should_populate_collections). Thanks -Chris #Code def it_should_populate_collections(condition=nil) it "should populate any necessary collections #{condition}" do [*@collections_to_populate].each do |collection| collection_model = collection.to_s.classify.constantize collection_model.should_receive(:find).with(:all).and_return("the #{collection}") end yield [*@collections_to_populate].each do |collection| assigns[collection].should == "the #{collection}" end end end descri...