Sha256: ea134e661b2392eddda720e9a6231f35d87347147d3eb0aa6dd4b57cbfce68aa

Contents?: true

Size: 661 Bytes

Versions: 5

Compression:

Stored size: 661 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'

class DelegatorTest < ActiveSupport::TestCase
  def delegator
    Devise::Delegator.new
  end

  test 'failure_app returns default failure app if no warden options in env' do
    assert_equal Devise::FailureApp, delegator.failure_app({})
  end

  test 'failure_app returns default failure app if no scope in warden options' do
    assert_equal Devise::FailureApp, delegator.failure_app({"warden.options" => {}})
  end

  test 'failure_app returns associated failure app by scope in the given environment' do
    assert_kind_of Proc, delegator.failure_app({"warden.options" => {scope: "manager"}})
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
devise-4.5.0 test/delegator_test.rb
devise-4.4.3 test/delegator_test.rb
devise-4.4.2 test/delegator_test.rb
devise-4.4.1 test/delegator_test.rb
devise-4.4.0 test/delegator_test.rb