Class: Hanko::TestHelper::StubVerifier

Inherits:
Object
  • Object
show all
Defined in:
lib/hanko/test_helper.rb

Overview

A simple stub that returns a fixed payload instead of verifying a token.

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ StubVerifier

Returns a new instance of StubVerifier.

Parameters:

  • payload (Hash)

    the payload to return on verify



21
22
23
# File 'lib/hanko/test_helper.rb', line 21

def initialize(payload)
  @payload = payload
end

Instance Method Details

#verify(_token) ⇒ Hash

Returns the fixed payload, ignoring the token.

Parameters:

  • _token (String)

    ignored

Returns:

  • (Hash)

    the stub payload



29
30
31
# File 'lib/hanko/test_helper.rb', line 29

def verify(_token)
  @payload
end