Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #869 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

[PATCH] make assert_redirect_to work with "redirect_to_path"

Reported by: chris@chrisbrinker.com Assigned to: David
Priority: low Milestone: 1.0
Component: ActionPack Version: 0.10.0
Severity: minor Keywords: assert_redirect_to, redirect_to_path
Cc:

Description

I found what I would consider to be a bug with the assert_redirect_to. Basically when the code in question performs a redirect_to_path the assert_redirect check breaks. Was puzzling me a little bit, especially with the "assert" throwing the errors.

Recreate make a piece of code that redirects via a redirect_to_path and run the test, it will throw the following stacktrace:

NoMethodError: undefined method `[]' for nil:NilClass

/usr/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/assertions/action_pack_assertions.rb:140:in `assert_redirected_to' /usr/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/assertions/action_pack_assertions.rb:140:in `all?' /usr/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/assertions/action_pack_assertions.rb:140:in `each' /usr/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/assertions/action_pack_assertions.rb:140:in `all?' /usr/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/assertions/action_pack_assertions.rb:140:in `assert_redirected_to' /usr/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/assertions/action_pack_assertions.rb:136:in `assert_block' /usr/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/assertions/action_pack_assertions.rb:136:in `assert_redirected_to'

Attachments

assert_redirects_with_path.patch (3.7 kB) - added by Ulysses on 05/13/05 12:24:37.
Patch adding blah blah blah it works and has tests, love it up

Change History

04/13/05 03:43:49 changed by anonymous

  • milestone set to 1.0.

05/13/05 12:24:37 changed by Ulysses

  • attachment assert_redirects_with_path.patch added.

Patch adding blah blah blah it works and has tests, love it up

05/13/05 12:27:14 changed by ulysses

  • summary changed from assert_redirect_to breaks when code performs a "redirect_to_path" to [PATCH] make assert_redirect_to work with "redirect_to_path".

05/19/05 19:20:04 changed by david

  • status changed from new to closed.
  • resolution set to fixed.