Welcome to mirror list, hosted at ThFree Co, Russian Federation.

devise_helpers.rb « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 890a2d9d2878950092091fe979bd993b1d14847d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module DeviseHelpers
  # explicitly tells Devise which mapping to use
  # this is needed when we are testing a Devise controller bypassing the router
  def set_devise_mapping(context:)
    env =
      if context.respond_to?(:env_config)
        context.env_config
      elsif context.respond_to?(:env)
        context.env
      end

    env['devise.mapping'] = Devise.mappings[:user] if env
  end
end