You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Rails 4, the default format route parameter may have been set to a symbol, but because shoulda stringifies the expected parameters given, it is impossible to match a route with a default format set to a symbol.
Try to match it and you will get an unhelpful error, like:
<{"format"=>"json",
"action"=>"show",
"controller"=>"api/users"}> expected but was
<{"format"=>:json,
"action"=>"show",
"controller"=>"api/users"}>
Even crazier, when you switch from back and forth from a symbol to a string in your tests, the error message alternates between the first and the second hash containing the symbol value.
A temporary fix is to use the RSpec route_to matcher, which does not stringify the values.
The text was updated successfully, but these errors were encountered:
In Rails 4, the default
format
route parameter may have been set to a symbol, but because shoulda stringifies the expected parameters given, it is impossible to match a route with a defaultformat
set to a symbol.Try to match it and you will get an unhelpful error, like:
Even crazier, when you switch from back and forth from a symbol to a string in your tests, the error message alternates between the first and the second hash containing the symbol value.
A temporary fix is to use the RSpec
route_to
matcher, which does not stringify the values.The text was updated successfully, but these errors were encountered: