由于散列上的序列,我遇到了实际与预期失败的问题。我不记得以前见过这个......无论如何我认为哈希是无序的?
我怎样才能通过这个测试?
RSpec.describe ArticleSectionsController, type: :routing do
describe "routing" do
it "routes to #index" do
expect(:get => "/articles/5/article_sections").to route_to("article_sections#index", article_id: 5)
end
end
end
1) ArticleSectionsController routing routes to #index
Failure/Error: expect(:get => "/articles/5/article_sections").to route_to("article_sections#index", article_id: 5)
The recognized options <{"controller"=>"article_sections", "action"=>"index", "article_id"=>"5"}> did not match <{"article_id"=>5, "controller"=>"article_sections", "action"=>"index"}>, difference:.
--- expected
+++ actual
@@ -1 +1 @@
-{"article_id"=>5, "controller"=>"article_sections", "action"=>"index"}
+{"controller"=>"article_sections", "action"=>"index", "article_id"=>"5"}