public
Rubygem
Description: Makes tests easy on the fingers and the eyes
Homepage: http://www.thoughtbot.com/projects/shoulda
Clone URL: git://github.com/thoughtbot/shoulda.git
added support for nil in should_redirect_to

git-svn-id: https://svn.thoughtbot.com/plugins/shoulda/trunk@199 
7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
tsaleh (author)
Fri Aug 31 07:09:04 -0700 2007
commit  a964a514e6fffb5c0a4fecb731d85ccd98944576
tree    b41b3978a038b3c676b713d0f3ace6ecde28ad1f
parent  5caf04201a920c50c53d8ecf5f50fc33345e4977
...
371
372
373
374
375
376
 
 
 
 
 
377
378
379
...
371
372
373
 
 
 
374
375
376
377
378
379
380
381
0
@@ -371,9 +371,11 @@ module ThoughtBot # :nodoc:
0
         #
0
         # should_redirect_to "/"
0
         def should_redirect_to(url)
0
- should "redirect to \"#{url}\"" do
0
- instantiate_variables_from_assigns do
0
- assert_redirected_to eval(url, self.send(:binding), __FILE__, __LINE__)
0
+ if url
0
+ should "redirect to \"#{url}\"" do
0
+ instantiate_variables_from_assigns do
0
+ assert_redirected_to eval(url, self.send(:binding), __FILE__, __LINE__)
0
+ end
0
             end
0
           end
0
         end

Comments

    No one has commented yet.