it "should assign to orders" do
assigns[:orders].should == @orders
end
On Sunday, March 6, 2011 at 7:05 PM, Dan Croak wrote:
Which blog post? What was the code that wasn't working for you?
Also have the same problem I followed the blog post but assign_to doesn't
work. Anything I can do to help?
--
Individuals over processes. Interactions over tools.
Agile Rails training from thoughtbot, the makers of Clearance, Shoulda, &
Factory Girl:
http://thoughtbot.com/services/training
The Shoulda group:
http://groups.google.com/group/shoulda
To post to this group, send email to
sho...@googlegroups.com
To unsubscribe from this group, send email to
shoulda+u...@googlegroups.com
Forwarded message:
Ok, full code comming upcontext "as admin" dobefore douser = Factory(:admin)@orders = []10.times do@orders << Factory(:order)endsign_in userUser.current = usercontroller.stubs(:current_user).returns(user)Order.stubs(:all_for_index).returns(@orders)get :indexendsubject { controller }it { should assign_to(:orders) } #this does not work# this works fine
it "should assign to orders" doassigns[:orders].should == @ordersend
it { should respond_with(:success) }it { should respond_with_content_type(:html) }it { should render_template(:index) }it { should_not set_the_flash }end