{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/19808","labels_url":"https://api.github.com/repos/rails/rails/issues/19808/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/19808/comments","events_url":"https://api.github.com/repos/rails/rails/issues/19808/events","html_url":"https://github.com/rails/rails/pull/19808","id":69314351,"number":19808,"title":"[PoC] Stop shadowing parameters named `action`","user":{"login":"byroot","id":44640,"avatar_url":"https://avatars.githubusercontent.com/u/44640?v=3","gravatar_id":"","url":"https://api.github.com/users/byroot","html_url":"https://github.com/byroot","followers_url":"https://api.github.com/users/byroot/followers","following_url":"https://api.github.com/users/byroot/following{/other_user}","gists_url":"https://api.github.com/users/byroot/gists{/gist_id}","starred_url":"https://api.github.com/users/byroot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/byroot/subscriptions","organizations_url":"https://api.github.com/users/byroot/orgs","repos_url":"https://api.github.com/users/byroot/repos","events_url":"https://api.github.com/users/byroot/events{/privacy}","received_events_url":"https://api.github.com/users/byroot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-18T14:39:02Z","updated_at":"2015-04-18T16:07:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/19808","html_url":"https://github.com/rails/rails/pull/19808","diff_url":"https://github.com/rails/rails/pull/19808.diff","patch_url":"https://github.com/rails/rails/pull/19808.patch"},"body":"NB: This is just a very rough PR to open the discussion.\r\n\r\n### What the problem is?\r\n\r\nIf you have an endpoint that expect a parameter named `action`, you have no way to test it. The test helpers simply don't allow you to pass such parameter.\r\n\r\n### Why don't you rename it to something else?\r\n\r\nUnfortunately I can't. It come from GitHub webhooks: https://developer.github.com/v3/activity/events/types/#membershipevent . And a little googling indicate that there is other use cases for this: http://stackoverflow.com/questions/6209848/how-to-not-use-rails-action-parameter-in-controller\r\n\r\nAnd in general I can't find any argument for `params[:action]` and `params[:controller]` to exist while there is `action_name` and `controller_name` methods on `ActionController::Base`.\r\n\r\nIMO those 2 params are leaky abstractions from the router, they should not be in accessed via `params`, and even less so override legitimate params.\r\n\r\nNot sure who to ping @rafaelfranca maybe?\r\n\r\nWould such change be accepted for Rails 5? If so I can submit a proper PR."},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/94177248","html_url":"https://github.com/rails/rails/pull/19808#issuecomment-94177248","issue_url":"https://api.github.com/repos/rails/rails/issues/19808","id":94177248,"user":{"login":"byroot","id":44640,"avatar_url":"https://avatars.githubusercontent.com/u/44640?v=3","gravatar_id":"","url":"https://api.github.com/users/byroot","html_url":"https://github.com/byroot","followers_url":"https://api.github.com/users/byroot/followers","following_url":"https://api.github.com/users/byroot/following{/other_user}","gists_url":"https://api.github.com/users/byroot/gists{/gist_id}","starred_url":"https://api.github.com/users/byroot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/byroot/subscriptions","organizations_url":"https://api.github.com/users/byroot/orgs","repos_url":"https://api.github.com/users/byroot/repos","events_url":"https://api.github.com/users/byroot/events{/privacy}","received_events_url":"https://api.github.com/users/byroot/received_events","type":"User","site_admin":false},"created_at":"2015-04-18T16:07:59Z","updated_at":"2015-04-18T16:07:59Z","body":"Yes, I forgot to mention that during a real request, you can access the actual value in either `request.query_parameters` or `request.request_parameters`.\r\n\r\nIMO it's not great but I can live with it, if you guys think it's too much of a breaking change.\r\n\r\nHowever what I believe should be fixed no matter what, is that you have no way to test such scenario, AFAIK you just can't pass an `action` parameter in `ActionController::TestCase`. And I see absolutely no reason for that.\r\n\r\nWould you agree for a PR that fixes that at least?\r\n"}}