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
shouldroutePATCH/notes/1to/from{:action=>"update",:foramt=>"json",:id=>"1",:controller=>"v1/notes"}(FAILED - 1)Failures:
1)V1::NotesControllerroutingshouldroutePATCH/notes/1to/from{:action=>"update",:foramt=>"json",:id=>"1",:controller=>"v1/notes"}Failure/Error: it{shouldroute(:patch,'/notes/1').to(action: :update,foramt: :json,id: 1)}Therecognizedoptions <{"format"=>:json,"controller"=>"v1/notes","action"=>"update","id"=>"1"}> did not match <{"action"=>"update","foramt"=>"json","id"=>"1","controller"=>"v1/notes"}>,difference:.
--- expected
+++ actual
@@ -1 +1 @@
-{"action"=>"update","foramt"=>"json","id"=>"1","controller"=>"v1/notes"}
+{"format"=>:json,"controller"=>"v1/notes","action"=>"update","id"=>"1"}# ./spec/controllers/v1/notes_controller_spec.rb:11:in `block (3 levels) in <top (required)>'# ./spec/rails_helper.rb:45:in `block (3 levels) in <top (required)>'# ./spec/rails_helper.rb:45:in `block (2 levels) in <top (required)>'# -e:1:in `<main>'
As far as I can see, the only difference is that is expects the value of format as a string ("json"), but gets it as a symbol (:json). The strange thing, though, is I have a couple of other routing specs, which work as expected:
Given the spec:
I get the following error:
As far as I can see, the only difference is that is expects the value of
format
as a string ("json"
), but gets it as a symbol (:json
). The strange thing, though, is I have a couple of other routing specs, which work as expected:so this happens only with patch.
If I remove the json constraint from my routes and from the specs, all the specs pass.
The text was updated successfully, but these errors were encountered: