class RuboCop::Cop::Rails::HttpPositionalArguments
def on_send(node)
def on_send(node) return if in_routing_block?(node) http_request?(node) do |data| return unless needs_conversion?(data) message = format(MSG, verb: node.method_name) add_offense(highlight_range(node), message: message) do |corrector| # given a pre Rails 5 method: get :new, {user_id: @user.id}, {} # # @return lambda of auto correct procedure # the result should look like: # get :new, params: { user_id: @user.id }, session: {} # the http_method is the method used to call the controller # the controller node can be a symbol, method, object or string # that represents the path/action on the Rails controller # the data is the http parameters and environment sent in # the Rails 5 http call corrector.replace(node.loc.expression, correction(node)) end end end