The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
No need to check response when testing redirects

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Matthew Bass

Posts: 468
Nickname: pelargir
Registered: Dec, 2005

Jared Richardson and Matthew Bass are independent software consultants
No need to check response when testing redirects Posted: Jul 4, 2007 4:02 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Matthew Bass.
Original Post: No need to check response when testing redirects
Feed Title: Pelargir
Feed URL: http://feeds.feedburner.com/pelargir/
Feed Description: Musings on software and life from Matthew Bass. Regular posts on new web products, tips and tricks, etc.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Matthew Bass
Latest Posts From Pelargir

Advertisement
Early on in my exploration of Rails, I got into the habit of testing that the response code of an action indicated a redirect. It turns out that this check is entirely unnecessary since assert_redirected_to makes an identical check: def assert_redirected_to(options = {}, message=nil)   clean_backtrace do     assert_response(:redirect, message)     ...   end end This is how one of my functional tests might have looked [...]

Read: No need to check response when testing redirects

Topic: Problems Downloading the Trial Edition Previous Topic   Next Topic Topic: Trend: India on a RoR wave

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use