[rspec-users] can't seem to test redirect?
Harry Bishop
lists at ruby-forum.com
Fri Oct 24 16:29:16 EDT 2008
Pat Maddox wrote:
>
> So there are two points you need to address right now:
> * How do you want this action to behave? (success or redirect?)
> * Don't stub behavior that you want to verify (if you want it to
> redirect, let it redirect)
>
> Pat
Hi Pat,
I am new to rspec and still trying to figure out testing the
controller. I'm not finding it straightforward for me since my app is
built and I am catching up with rspec. I had done unit and functional
testing with TestCase. But I found the individual tests awkward.
So, I constructed this example to get the create action called and a
successful response (200). That worked. The next part of the create
action on a successful @motion save is to redirect back to show the
motion.
How do I test this redirect action?
When I take out the stub for redirect I get the following error:
undefined method `spec_mocks_mocks_url' for
#<MotionsController:0x22604ec>
Harry
--
Posted via http://www.ruby-forum.com/.
More information about the rspec-users
mailing list