Permalink
Browse files

Alias in params method for TestRequest when it isn't present.

  • Loading branch information...
1 parent 2a33f3e commit 63f752c309360200bb41ed4a254c04286d001785 @Shadowfiend Shadowfiend committed with binarylogic May 8, 2009
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/authlogic/test_case.rb
@@ -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
@@ -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.