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

Ticket #1498 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

[PATCH] bug with assert_generates

Reported by: rick Assigned to: ulysses
Priority: normal Milestone:
Component: ActionPack Version: 0.12.1
Severity: normal Keywords: assertion routing
Cc:

Description

Looks like the new routing stuff broke assert_generates. I get:

NoMethodError: undefined method `join' for "controller/action/5":String

./test/controller/../../lib/action_controller/assertions.rb:124:in `assert_generates' test/controller/test_test.rb:89:in `test_assert_routing'

RouteSet#generate returns a string, so assert_generates does not need to bother joining it.

Attachments

assert_generates_fix.diff (1.2 kB) - added by rick on 06/25/05 09:20:52.
fix + test
assert_routing_fix.diff (2.0 kB) - added by rick on 06/25/05 10:17:29.
fixes for assert_generates and assert_recognizes. test for assert_generates

Change History

06/25/05 09:20:52 changed by rick

  • attachment assert_generates_fix.diff added.

fix + test

06/25/05 10:15:51 changed by rick

I noticed that assert_recognizes wants a path that begins with a slash, and an options hash with string keys. I added a couple lines to that method so that assert_routing, assert_generates, and assert_recognizes accepts the same path and options.

Also, I tried to write some tests for assert_routing in controller/test_test.rb, but kept getting:

NameError: uninitialized constant Controllers

./controller/../../lib/../../activesupport/lib/active_support/dependencies.rb:186:in `const_missing' ./controller/../../lib/action_controller/routing.rb:211:in `traverse_to_controller' (eval):3:in `recognize_path' ./controller/../../lib/action_controller/routing.rb:415:in `recognize!' ./controller/../../lib/action_controller/assertions.rb:104:in `assert_recognizes' ./controller/../../lib/action_controller/assertions.rb:137:in `assert_routing' controller/test_test.rb:90:in `test_assert_routing'

06/25/05 10:17:29 changed by rick

  • attachment assert_routing_fix.diff added.

fixes for assert_generates and assert_recognizes. test for assert_generates

06/25/05 10:44:44 changed by anonymous

  • owner changed from David to nseckar@gmail.com.

06/25/05 10:58:52 changed by david

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