Sha256: 711c85a9859589c20e4049da619c7f6c6ab2c6a953ac5e0a44b664191474c65f

Contents?: true

Size: 902 Bytes

Versions: 19

Compression:

Stored size: 902 Bytes

Contents

# The only reason I am doing all of this non sense is becuase the openid_authentication requires that
# these constants be present. The only other alternative is to use an entire rails application for testing
# which is a little too overboard for this, I think.

RAILS_ROOT = ''

class ActionController < Authlogic::TestCase::MockController
  class Request < Authlogic::TestCase::MockRequest
    def request_method
      ""
    end
  end
  
  def root_url
    ''
  end
  
  def request
    return @request if defined?(@request)
    super
    # Rails does some crazy s#!t with the "method" method. If I don't do this I get a "wrong arguments (0 for 1) error"
    @request.class.class_eval do
      def method
        nil
      end
    end
    @request
  end
  
  def url_for(*args)
    ''
  end
  
  def redirecting_to
    @redirect_to
  end
  
  def redirect_to(*args)
    @redirect_to = args
  end
end

Version data entries

19 entries across 19 versions & 9 rubygems

Version Path
quantipay-authlogic_haapi-1.0.2 test/libs/rails_trickery.rb
quantipay-authlogic_haapi-1.0.3 test/libs/rails_trickery.rb
tardate-authlogic_rpx-1.0.0 test/libs/rails_trickery.rb
tardate-authlogic_rpx-1.0.1 test/libs/rails_trickery.rb
tardate-authlogic_rpx-1.0.2 test/libs/rails_trickery.rb
tfe-authlogic_openid-0.1.0 test/libs/rails_trickery.rb
authlogic_haapi-1.0.4 test/libs/rails_trickery.rb
nielsm-authlogic_haapi-1.0.4 test/libs/rails_trickery.rb
sidonath-authlogic_rpx-1.0.4em test/libs/rails_trickery.rb
sidonath-authlogic_rpx-1.0.4b test/libs/rails_trickery.rb
czak-authlogic-oid-1.0.4 test/libs/rails_trickery.rb
czak-authlogic-oid-1.0.5 test/libs/rails_trickery.rb
heyzap-authlogic-oid-1.0.6 test/libs/rails_trickery.rb
heyzap-authlogic-oid-1.0.5 test/libs/rails_trickery.rb
authlogic-oid-1.0.0 test/libs/rails_trickery.rb
authlogic-oid-1.0.4 test/libs/rails_trickery.rb
authlogic-oid-1.0.2 test/libs/rails_trickery.rb
authlogic-oid-1.0.1 test/libs/rails_trickery.rb
authlogic-oid-1.0.3 test/libs/rails_trickery.rb