[test] assert response or redirect

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

On 5/19/07, Kad K. [email protected] 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-driven-rjs-with-arts

or do a ‘real’ redirection.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs