{"action":"created","issue":{"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/809","labels_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/809/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/809/comments","events_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/809/events","html_url":"https://github.com/thoughtbot/shoulda-matchers/issues/809","id":111729704,"number":809,"title":"Using the route matcher with 'format' can lead to failing specs, while everything is correct","user":{"login":"aried3r","id":1301152,"avatar_url":"https://avatars.githubusercontent.com/u/1301152?v=3","gravatar_id":"","url":"https://api.github.com/users/aried3r","html_url":"https://github.com/aried3r","followers_url":"https://api.github.com/users/aried3r/followers","following_url":"https://api.github.com/users/aried3r/following{/other_user}","gists_url":"https://api.github.com/users/aried3r/gists{/gist_id}","starred_url":"https://api.github.com/users/aried3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aried3r/subscriptions","organizations_url":"https://api.github.com/users/aried3r/orgs","repos_url":"https://api.github.com/users/aried3r/repos","events_url":"https://api.github.com/users/aried3r/events{/privacy}","received_events_url":"https://api.github.com/users/aried3r/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-10-15T23:46:20Z","updated_at":"2015-12-17T17:27:15Z","closed_at":null,"body":"When having a route, or namespace like this:\r\n```Ruby\r\nnamespace :api, defaults: { format: 'json' } do\r\n  # some routes\r\nend\r\n```\r\nand trying to assert this behavior using the `route` shoulda-matcher\r\n```Ruby\r\nit { is_expected.to route(:get, '/api/projects/1').to(action: :show, id: 1, format: :json) }\r\n```\r\nthe spec will fail with something like:\r\n```diff\r\nThe recognized options <{\"controller\"=>\"projects\", \"action\"=>\"show\", \"id\"=>\"1\", \"format\"=>\"json\"}> did not match <{\"action\"=>\"show\", \"id\"=>\"1\", \"format\"=>:json, \"controller\"=>\"projects\"}>, difference:.\r\n--- expected\r\n+++ actual\r\n@@ -1 +1 @@\r\n-{\"action\"=>\"show\", \"id\"=>\"1\", \"format\"=>:json, \"controller\"=>\"projects\"}\r\n+{\"controller\"=>\"projects\", \"action\"=>\"show\", \"id\"=>\"1\", \"format\"=>\"json\"}\r\n```\r\nbecause the matcher will try to match the symbol (spec) against a string (`route.rb`).\r\n\r\nSee https://github.com/thoughtbot/shoulda-matchers/pull/693 for more details."},"comment":{"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/comments/165521372","html_url":"https://github.com/thoughtbot/shoulda-matchers/issues/809#issuecomment-165521372","issue_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/809","id":165521372,"user":{"login":"dolzenko","id":43391,"avatar_url":"https://avatars.githubusercontent.com/u/43391?v=3","gravatar_id":"","url":"https://api.github.com/users/dolzenko","html_url":"https://github.com/dolzenko","followers_url":"https://api.github.com/users/dolzenko/followers","following_url":"https://api.github.com/users/dolzenko/following{/other_user}","gists_url":"https://api.github.com/users/dolzenko/gists{/gist_id}","starred_url":"https://api.github.com/users/dolzenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolzenko/subscriptions","organizations_url":"https://api.github.com/users/dolzenko/orgs","repos_url":"https://api.github.com/users/dolzenko/repos","events_url":"https://api.github.com/users/dolzenko/events{/privacy}","received_events_url":"https://api.github.com/users/dolzenko/received_events","type":"User","site_admin":false},"created_at":"2015-12-17T17:27:15Z","updated_at":"2015-12-17T17:27:15Z","body":"@aried3r no, the whole thing is useless then https://github.com/thoughtbot/shoulda-matchers/blob/8253d4b4c9b5489ea003784e638e04db353f6250/lib/shoulda/matchers/action_controller/route_params.rb#L6"}}