1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/test/path_checker_test.rb

21 lines
725 B
Ruby
Raw Normal View History

require 'test_helper'
class PathCheckerTest < ActiveSupport::TestCase
test 'check if sign out path matches' do
path_checker = Devise::PathChecker.new({"PATH_INFO" => "/users/sign_out"}, :user)
assert path_checker.signing_out?
path_checker = Devise::PathChecker.new({"PATH_INFO" => "/users/sign_in"}, :user)
assert_not path_checker.signing_out?
end
test 'considers script name' do
path_checker = Devise::PathChecker.new({"SCRIPT_NAME" => "/users", "PATH_INFO" => "/sign_out"}, :user)
assert path_checker.signing_out?
end
test 'ignores invalid routes' do
path_checker = Devise::PathChecker.new({"PATH_INFO" => "/users/sign_in"}, :omg)
assert_not path_checker.signing_out?
end
end