Forum: Ruby on Rails [test] assert response or redirect

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.
Ee0293412faca21e4ebf3326ed9d5f8c?d=identicon&s=25 Kad Kerforn (kadoudal)
on 2007-05-19 20:00
I am testing  my update action

      render :update do |page|
        page.redirect_to :controller => 'proposals', :action => 'list'
      end


if I asser a response

    post :update
    assert_response 200


it's OK

but not if I try to assert the redirect

assert_redirected_to "/proposals/list/"


is it the right assertion ?

tfy help

kad
Be1e3ee645d23c95ba650c21bc885927?d=identicon&s=25 Fabien Jakimowicz (Guest)
on 2007-05-20 15:38
(Received via mailing list)
On 5/19/07, Kad Kerforn <rails-mailing-list@andreas-s.net> wrote:
>
>
> is it the right assertion ?
>
> tfy help
>
> kad


This redirection is done via ajax calls, response will always be 200.
You should take a look at this plugin to test ajax calls :
http://glu.ttono.us/articles/2006/05/29/guide-test...

or do a 'real' redirection.
This topic is locked and can not be replied to.