Navigation Menu

Skip to content

Commit

Permalink
Alias in params method for TestRequest when it isn't present.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadowfiend authored and binarylogic committed Nov 12, 2009
1 parent 2a33f3e commit 63f752c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/authlogic/test_case.rb
Expand Up @@ -100,6 +100,12 @@ module TestCase
#
# setup :activate_authlogic
def activate_authlogic
if @request && ! @request.respond_to?(:params)
class <<@request
alias_method :params, :parameters
end
end

Authlogic::Session::Base.controller = (@request && Authlogic::TestCase::RailsRequestAdapter.new(@request)) || controller
end

Expand All @@ -111,4 +117,4 @@ def controller
end

::Test::Unit::TestCase.send(:include, TestCase) if defined?(::Test::Unit::TestCase)
end
end

0 comments on commit 63f752c

Please sign in to comment.