1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/test/delegator_test.rb
2014-02-25 22:12:55 +05:30

19 lines
630 B
Ruby

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