blinking bear wrote:
> assert_redirected_to :controller => "/users/profile",
:action =>
> "index", :id => users(:nathan).id
> RuntimeError: The number of parameters does not match the number of
> substitutions. on the assert_redirect_to line.
The point of TDD is to go beyond matching each line of code with an
identical line of test. You should instead accept the redirection, render
the target page, and then use assert_select to reach in for some artifact
that shows your data is getting thru to the user.
Look up "integration tests", then add one for this scenario. And
don''t let
the names fool you - Rails may claim to support functional, integration, and
unit tests, but they are all just TDD tests. (Those things have strict QA
definitions that we don''t care about.)
The difference between the test categories is the avaliable
"fixtures", or
reusable support code. So integration tests will be able to follow you into
the redirected page.
> Any ideas?
Reduce :controller => "/users/profile" to just the name of your
controller;
either :users or :profile. Let the assertion figure out the rest.
--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---