0
ハッシュのシーケンスのために実際のものと予想されるもののどちらかに問題があります。私はこれを前に見て回想していない...とにかく私はハッシュが順序付けられていないと思った?RSpecルーティング仕様:ハッシュ内のフィールドのシーケンス
どうすればこのテストに合格することができますか?
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"}
長い日...少なくとも私は怒っていない!ありがとう@SteveTurczyn。 – ardochhigh