Forum: Ruby on Rails assert_redirected_to

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2ebf42f8625b86c0e91ae7bd4e2bef52?d=identicon&s=25 Raymond O'Connor (nappin)
on 2007-01-18 19:53
Hi,
I have an index action in one controller.  This action redirects you to
an account_options action (in another controller) if a session var is
set or it redirects the user to login (which is also in a diff
controller from the index action).  I get strange behavior when testing
this action.  The login redirect only seems to work if I use the
following as strings (which I believe is the correct way):
assert_redirected_to :controller => 'accounts', :action => 'login'
Yet, testing the redirect to account_options only passes when I put the
controller and action as symbols. Such as:
assert_redirected_to :controller => :accounts, :action =>
:account_options

Any idea why this occurs?
Thanks,
Ray
This topic is locked and can not be replied to.