rails/actionpack/test/dispatch
schneems 0b6175ac2d Add Missing Keys from Journey on failed URL format
Many named routes have keys that are required to successfully resolve. If a key is left off like this:

    <%= link_to 'user', user_path %>

This will produce an error like this:

    No route matches {:action=>"show", :controller=>"users"}

Since we know that the :id is missing, we can add extra debugging information to the error message.

    No route matches {:action=>"show", :controller=>"users"} missing required keys: [:id]


This will help new and seasoned developers look closer at their parameters. I've also subclassed the routing error to be clear that this error is a result of attempting to generate a url and not because the user is trying to visit a bad url. 

While this may sound trivial this error message is misleading and confuses most developers. The important part isn't what's in the options its's what's missing. Adding this information to the error message will make debugging much more obvious. 

This is the sister pull request of https://github.com/rails/journey/pull/44 which will be required to get they missing keys into the correct error message. 

Example Development Error in Rails: http://cl.ly/image/3S0T0n1T3421
2012-08-28 08:53:45 -07:00
..
middleware_stack make sure string keys are always looked up from the class cache 2011-03-02 10:11:28 -08:00
request Fix build 2012-06-13 20:21:35 -03:00
routing Extract common controllers to abstract_unit 2012-08-13 21:43:18 -03:00
session Add missing require 2012-08-28 10:12:49 -03:00
callbacks_test.rb ActionDispatch: add missing test for callbacks 2012-02-16 15:58:58 +02:00
cookies_test.rb Test actual content of permanent cookie 2012-08-10 09:48:26 +04:00
debug_exceptions_test.rb Add Missing Keys from Journey on failed URL format 2012-08-28 08:53:45 -07:00
header_test.rb Enable ActionDispatch::Http::Headers to support fetch 2012-05-02 11:22:34 -07:00
live_response_test.rb push header merge down to a private method so that live responses can have their own header object 2012-08-13 14:20:04 -04:00
mapper_test.rb Raise a helpful error message on #mount misuse 2012-07-10 16:17:02 -07:00
middleware_stack_test.rb Add the #unshift method to the middleware stack 2012-05-18 16:41:52 +10:00
mime_type_test.rb Prevent conflict between mime types and Object methods 2012-07-06 20:38:23 +02:00
mount_test.rb Make sure :via works with mount 2012-08-20 10:25:23 -05:00
prefix_generation_test.rb Fix handling SCRIPT_NAME from within mounted engine's 2012-08-11 00:21:46 +02:00
rack_cache_test.rb Dump and load rack-cache stuff. 2011-05-17 17:33:17 -04:00
rack_test.rb * Change the object used in routing constraints to be an instance of 2010-04-03 20:24:30 -07:00
reloader_test.rb Use a BodyProxy instead of including a Module that responds to close. 2012-01-13 19:46:13 -02:00
request_id_test.rb Remove default match without specified method 2012-04-24 22:52:26 -05:00
request_test.rb Remove ActionDispatch::Head middleware in favor of Rack::Head 2012-07-23 14:34:13 -03:00
response_test.rb Added X-Content-Type-Options to the header defaults. 2012-08-18 15:29:58 -07:00
routing_assertions_test.rb Raise Assertion instead of RoutingError for routing assertion failures. 2012-05-20 06:21:32 -05:00
routing_test.rb Add Missing Keys from Journey on failed URL format 2012-08-28 08:53:45 -07:00
show_exceptions_test.rb Removed unused assigns from ActionView::Template::Error 2012-01-20 20:13:29 +04:00
ssl_test.rb Fix secure cookies when there are more than one space before the secure 2012-03-19 16:31:57 -03:00
static_test.rb fix ArgumentError being raised in case of invalid byte sequences 2012-03-08 20:41:25 +09:00
test_request_test.rb Fix bug when Rails.application is defined but is nil. See #881 2012-05-21 15:24:18 -04:00
test_response_test.rb Add ActionDispatch::TestResponse tests. 2010-09-25 10:52:57 +02:00
uploaded_file_test.rb adds delegetion for eof? to AD::Http::UploadedFile 2012-03-27 22:53:33 +02:00
url_generation_test.rb Add passing tests for generating URLs with nested SCRIPT_NAMEs 2012-05-07 14:53:57 -07:00