Re: [rspec] how to check with rspec if controller action set needed instance variables ?

212 views
Skip to first unread message

Alex Chaffee

unread,
Dec 13, 2012, 4:38:34 PM12/13/12
to rs...@googlegroups.com, rs...@googlegroups.com
get :view_tub, :tub => "rubadub"
assigns[:tub].should == "rubadub"

("assigns" is Railsese for "controller instance variables that get ripped out if the controller and stuck into the view" and it's magically set in Request and Controller specs)

On Dec 13, 2012, at 2:23 AM, Alex Leasenco <alexw...@gmail.com> wrote:

def view_tub
 @tub = params[:tub]
 @back_to = view_path(@camp)
end

Thanks
Alex

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To post to this group, send email to rs...@googlegroups.com.
To unsubscribe from this group, send email to rspec+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rspec/-/-VuzWZqULH4J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alex

unread,
Dec 14, 2012, 3:56:47 PM12/14/12
to rs...@googlegroups.com
Thanks Alex, you are the best ;) 
Reply all
Reply to author
Forward
0 new messages