From 0b32e2dff353ceb9bc463787c5897ecae7302ab7 Mon Sep 17 00:00:00 2001 From: Chris Carter Date: Tue, 20 Sep 2016 10:42:26 +0100 Subject: Show an "unmatched constraints" error for mismatching and present params Currently a misleading "missing required keys" error is thrown when a param fails to match the constraints of a particular route. This commit ensures that these params are recognised as unmatching rather than missing. Note: this means that a different error message will be provided between optimized and non-optimized path helpers, due to the fact that the former does not check constraints when matching routes. Fixes #26470. --- actionpack/test/journey/router_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/test/journey') diff --git a/actionpack/test/journey/router_test.rb b/actionpack/test/journey/router_test.rb index 2b99637f56..7b5916eb72 100644 --- a/actionpack/test/journey/router_test.rb +++ b/actionpack/test/journey/router_test.rb @@ -297,7 +297,7 @@ module ActionDispatch } request_parameters = primarty_parameters.merge(redirection_parameters).merge(missing_parameters) - message = "No route matches #{Hash[request_parameters.sort_by { |k,v|k.to_s }].inspect} missing required keys: #{[missing_key.to_sym].inspect}" + message = "No route matches #{Hash[request_parameters.sort_by { |k,v|k.to_s }].inspect}, missing required keys: #{[missing_key.to_sym].inspect}" error = assert_raises(ActionController::UrlGenerationError) do @formatter.generate( -- cgit v1.2.3