Skip to content

Instantly share code, notes, and snippets.

@lmarburger
Forked from dpickett/gist:34737
Created December 11, 2008 15:44
Show Gist options
  • Save lmarburger/34751 to your computer and use it in GitHub Desktop.
Save lmarburger/34751 to your computer and use it in GitHub Desktop.
class ActionView::TestCase
class TestController < ActionController::Base
attr_accessor :params
# Save the current initialize method to call in the new initialize method below.
alias_method :base_initialize, :initialize
def initialize
base_initialize
#Hack Hack Hack: TestCase doesn't have context of a current url so cheat a bit
@params = {}
send(:initialize_current_url)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment