Skip to content

Instantly share code, notes, and snippets.

@spalladino
Created December 2, 2011 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spalladino/1423757 to your computer and use it in GitHub Desktop.
Save spalladino/1423757 to your computer and use it in GitHub Desktop.
Default request parameters in Rails functional tests
class ActionController::TestCase < ActiveSupport::TestCase
module Behavior
def process_with_default_params(action, parameters = nil, session = nil, flash = nil, http_method = 'GET')
default_params = {:locale => :en}
parameters ||= {}
parameters.reverse_merge! default_params
process_without_default_params(action, parameters, session, flash, http_method)
end
alias_method_chain :process, :default_params
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment