repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/framework.rb
lib/capistrano/framework.rb
load File.expand_path("../tasks/framework.rake", __FILE__) require "capistrano/install"
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/proc_helpers.rb
lib/capistrano/proc_helpers.rb
module Capistrano module ProcHelpers module_function # Tests whether the given object appears to respond to `call` with # zero parameters. In Capistrano, such a proc is used to represent a # "deferred value". That is, a value that is resolved by invoking `call` at # the time it is first needed. ...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/all.rb
lib/capistrano/all.rb
require "rake" require "sshkit" require "io/console" Rake.application.options.trace = true require "capistrano/version" require "capistrano/version_validator" require "capistrano/i18n" require "capistrano/dsl" require "capistrano/application" require "capistrano/configuration" require "capistrano/configuration/scm_r...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/dsl/stages.rb
lib/capistrano/dsl/stages.rb
module Capistrano module DSL module Stages RESERVED_NAMES = %w(deploy doctor install).freeze private_constant :RESERVED_NAMES def stages names = Dir[stage_definitions].map { |f| File.basename(f, ".rb") } assert_valid_stage_names(names) names end def stage_de...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/dsl/env.rb
lib/capistrano/dsl/env.rb
require "forwardable" module Capistrano module DSL module Env extend Forwardable def_delegators :env, :configure_backend, :fetch, :set, :set_if_empty, :delete, :ask, :role, :server, :primary, :validate, :append, :remove, :dry_run?, :insta...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/dsl/paths.rb
lib/capistrano/dsl/paths.rb
require "pathname" module Capistrano module DSL module Paths def deploy_to fetch(:deploy_to) end def deploy_path Pathname.new(deploy_to) end def current_path deploy_path.join(fetch(:current_directory, "current")) end def releases_path de...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/dsl/task_enhancements.rb
lib/capistrano/dsl/task_enhancements.rb
require "capistrano/upload_task" module Capistrano module TaskEnhancements def before(task, prerequisite, *args, &block) prerequisite = Rake::Task.define_task(prerequisite, *args, &block) if block_given? Rake::Task[task].enhance [prerequisite] end def after(task, post_task, *args, &block) ...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/configuration/plugin_installer.rb
lib/capistrano/configuration/plugin_installer.rb
# Encapsulates the logic for installing plugins into Capistrano. Plugins must # simply conform to a basic API; the PluginInstaller takes care of invoking the # API at appropriate times. # # This class is not used directly; instead it is typically accessed via the # `install_plugin` method of the Capistrano DSL. # modul...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/configuration/servers.rb
lib/capistrano/configuration/servers.rb
require "set" require "capistrano/configuration" require "capistrano/configuration/filter" module Capistrano class Configuration class Servers include Enumerable def add_host(host, properties={}) new_host = Server[host] new_host.port = properties[:port] if properties.key?(:port) ...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/configuration/null_filter.rb
lib/capistrano/configuration/null_filter.rb
module Capistrano class Configuration class NullFilter def filter(servers) servers end end end end
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/configuration/host_filter.rb
lib/capistrano/configuration/host_filter.rb
module Capistrano class Configuration class HostFilter def initialize(values) av = Array(values).dup av = av.flat_map { |v| v.is_a?(String) && v =~ /^(?<name>[-A-Za-z0-9.]+)(,\g<name>)*$/ ? v.split(",") : v } @rex = regex_matcher(av) end def filter(servers) Array...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/configuration/variables.rb
lib/capistrano/configuration/variables.rb
require "capistrano/proc_helpers" module Capistrano class Configuration # Holds the variables assigned at Capistrano runtime via `set` and retrieved # with `fetch`. Does internal bookkeeping to help identify user mistakes # like spelling errors or unused variables that may lead to unexpected # behavi...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/configuration/filter.rb
lib/capistrano/configuration/filter.rb
require "capistrano/configuration" require "capistrano/configuration/empty_filter" require "capistrano/configuration/host_filter" require "capistrano/configuration/null_filter" require "capistrano/configuration/role_filter" module Capistrano class Configuration class Filter def initialize(type, values=nil)...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/configuration/role_filter.rb
lib/capistrano/configuration/role_filter.rb
module Capistrano class Configuration class RoleFilter def initialize(values) av = Array(values).dup av = av.flat_map { |v| v.is_a?(String) ? v.split(",") : v } @rex = regex_matcher(av) end def filter(servers) Array(servers).select { |s| s.is_a?(String) ? false :...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/configuration/empty_filter.rb
lib/capistrano/configuration/empty_filter.rb
module Capistrano class Configuration class EmptyFilter def filter(_servers) [] end end end end
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/configuration/question.rb
lib/capistrano/configuration/question.rb
module Capistrano class Configuration class Question def initialize(key, default, options={}) @key = key @default = default @options = options end def call ask_question value_or_default end private attr_reader :key, :default, :options ...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/configuration/server.rb
lib/capistrano/configuration/server.rb
require "set" module Capistrano class Configuration class Server < SSHKit::Host extend Forwardable def_delegators :properties, :roles, :fetch, :set def self.[](host) host.is_a?(Server) ? host : new(host) end def add_roles(roles) Array(roles).each { |role| add_role(r...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/configuration/validated_variables.rb
lib/capistrano/configuration/validated_variables.rb
require "capistrano/proc_helpers" require "delegate" module Capistrano class Configuration # Decorates a Variables object to additionally perform an optional set of # user-supplied validation rules. Each rule for a given key is invoked # immediately whenever `set` is called with a value for that key. ...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/configuration/scm_resolver.rb
lib/capistrano/configuration/scm_resolver.rb
module Capistrano class Configuration # In earlier versions of Capistrano, users would specify the desired SCM # implementation using `set :scm, :git`, for example. Capistrano would then # load the matching .rb file based on this variable. # # Now we expect users to explicitly `require` and call `...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/doctor/output_helpers.rb
lib/capistrano/doctor/output_helpers.rb
module Capistrano module Doctor # Helper methods for pretty-printing doctor output to stdout. All output # (other than `title`) is indented by four spaces to facilitate copying and # pasting this output into e.g. GitHub or Stack Overflow to achieve code # formatting. module OutputHelpers cla...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/doctor/environment_doctor.rb
lib/capistrano/doctor/environment_doctor.rb
require "capistrano/doctor/output_helpers" module Capistrano module Doctor class EnvironmentDoctor include Capistrano::Doctor::OutputHelpers def call title("Environment") puts <<-OUT.gsub(/^\s+/, "") Ruby #{RUBY_DESCRIPTION} Rubygems #{Gem::VERSION} ...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/doctor/servers_doctor.rb
lib/capistrano/doctor/servers_doctor.rb
require "capistrano/doctor/output_helpers" module Capistrano module Doctor class ServersDoctor include Capistrano::Doctor::OutputHelpers def initialize(env=Capistrano::Configuration.env) @servers = env.servers.to_a end def call title("Servers (#{servers.size})") ...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/doctor/variables_doctor.rb
lib/capistrano/doctor/variables_doctor.rb
require "capistrano/doctor/output_helpers" module Capistrano module Doctor # Prints a table of all Capistrano variables and their current values. If # there are unrecognized variables, print warnings for them. class VariablesDoctor # These are keys that are recognized by Capistrano, but do not have...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/doctor/gems_doctor.rb
lib/capistrano/doctor/gems_doctor.rb
require "capistrano/doctor/output_helpers" module Capistrano module Doctor # Prints table of all Capistrano-related gems and their version numbers. If # there is a newer version of a gem available, call attention to it. class GemsDoctor include Capistrano::Doctor::OutputHelpers def call ...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/scm/plugin.rb
lib/capistrano/scm/plugin.rb
require "capistrano/plugin" require "capistrano/scm" # Base class for all built-in and third-party SCM plugins. Notice that this # class doesn't really do anything other than provide an `scm?` predicate. This # tells Capistrano that the plugin provides SCM functionality. All other plugin # features are inherited from ...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/scm/svn.rb
lib/capistrano/scm/svn.rb
require "capistrano/scm/plugin" class Capistrano::SCM::Svn < Capistrano::SCM::Plugin def register_hooks after "deploy:new_release_path", "svn:create_release" before "deploy:check", "svn:check" before "deploy:set_current_revision", "svn:set_current_revision" end def define_tasks eval_rakefile Fil...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/scm/hg.rb
lib/capistrano/scm/hg.rb
require "capistrano/scm/plugin" require "securerandom" class Capistrano::SCM::Hg < Capistrano::SCM::Plugin def register_hooks after "deploy:new_release_path", "hg:create_release" before "deploy:check", "hg:check" before "deploy:set_current_revision", "hg:set_current_revision" end def define_tasks ...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
capistrano/capistrano
https://github.com/capistrano/capistrano/blob/dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334/lib/capistrano/scm/git.rb
lib/capistrano/scm/git.rb
require "capistrano/scm/plugin" require "cgi" require "securerandom" require "shellwords" require "stringio" require "uri" class Capistrano::SCM::Git < Capistrano::SCM::Plugin def set_defaults set_if_empty :git_shallow_clone, false set_if_empty :git_wrapper_path, lambda { # Use a unique name that won't...
ruby
MIT
dfe3133012d7d7d4fcd3f34d2790bcaeb4e8c334
2026-01-04T15:37:35.862177Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/app/helpers/devise_helper.rb
app/helpers/devise_helper.rb
# frozen_string_literal: true # Keeping the helper around for backward compatibility. module DeviseHelper end
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/app/controllers/devise_controller.rb
app/controllers/devise_controller.rb
# frozen_string_literal: true # All Devise controllers are inherited from here. class DeviseController < Devise.parent_controller.constantize include Devise::Controllers::ScopedViews if respond_to?(:helper) helper DeviseHelper end if respond_to?(:helper_method) helpers = %w(resource scope_name resour...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/app/controllers/devise/omniauth_callbacks_controller.rb
app/controllers/devise/omniauth_callbacks_controller.rb
# frozen_string_literal: true class Devise::OmniauthCallbacksController < DeviseController prepend_before_action { request.env["devise.skip_timeout"] = true } def passthru render status: 404, plain: "Not found. Authentication passthru." end def failure set_flash_message! :alert, :failure, kind: OmniA...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/app/controllers/devise/passwords_controller.rb
app/controllers/devise/passwords_controller.rb
# frozen_string_literal: true class Devise::PasswordsController < DeviseController prepend_before_action :require_no_authentication # Render the #edit only if coming from a reset password email link append_before_action :assert_reset_token_passed, only: :edit # GET /resource/password/new def new self.re...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/app/controllers/devise/unlocks_controller.rb
app/controllers/devise/unlocks_controller.rb
# frozen_string_literal: true class Devise::UnlocksController < DeviseController prepend_before_action :require_no_authentication # GET /resource/unlock/new def new self.resource = resource_class.new end # POST /resource/unlock def create self.resource = resource_class.send_unlock_instructions(re...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/app/controllers/devise/registrations_controller.rb
app/controllers/devise/registrations_controller.rb
# frozen_string_literal: true class Devise::RegistrationsController < DeviseController prepend_before_action :require_no_authentication, only: [:new, :create, :cancel] prepend_before_action :authenticate_scope!, only: [:edit, :update, :destroy] prepend_before_action :set_minimum_password_length, only: [:new, :ed...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/app/controllers/devise/confirmations_controller.rb
app/controllers/devise/confirmations_controller.rb
# frozen_string_literal: true class Devise::ConfirmationsController < DeviseController # GET /resource/confirmation/new def new self.resource = resource_class.new end # POST /resource/confirmation def create self.resource = resource_class.send_confirmation_instructions(resource_params) yield res...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/app/controllers/devise/sessions_controller.rb
app/controllers/devise/sessions_controller.rb
# frozen_string_literal: true class Devise::SessionsController < DeviseController prepend_before_action :require_no_authentication, only: [:new, :create] prepend_before_action :allow_params_authentication!, only: :create prepend_before_action :verify_signed_out_user, only: :destroy prepend_before_action(only: ...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/app/mailers/devise/mailer.rb
app/mailers/devise/mailer.rb
# frozen_string_literal: true if defined?(ActionMailer) class Devise::Mailer < Devise.parent_mailer.constantize include Devise::Mailers::Helpers def confirmation_instructions(record, token, opts = {}) @token = token devise_mail(record, :confirmation_instructions, opts) end def reset_pas...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/failure_app_test.rb
test/failure_app_test.rb
# frozen_string_literal: true require 'test_helper' require 'ostruct' class FailureTest < ActiveSupport::TestCase class RootFailureApp < Devise::FailureApp def fake_app Object.new end end class FailureWithSubdomain < RootFailureApp routes = ActionDispatch::Routing::RouteSet.new routes.dr...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/routes_test.rb
test/routes_test.rb
# frozen_string_literal: true require 'test_helper' ExpectedRoutingError = Minitest::Assertion class DefaultRoutingTest < ActionController::TestCase test 'map new user session' do assert_recognizes({controller: 'devise/sessions', action: 'new'}, {path: 'users/sign_in', method: :get}) assert_named_route "/u...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/devise_test.rb
test/devise_test.rb
# frozen_string_literal: true require 'test_helper' module Devise def self.yield_and_restore @@warden_configured = nil c, b = @@warden_config, @@warden_config_blocks yield ensure @@warden_config, @@warden_config_blocks = c, b end end class DeviseTest < ActiveSupport::TestCase test 'bcrypt on ...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/test_models.rb
test/test_models.rb
# frozen_string_literal: true class Configurable < User devise :database_authenticatable, :confirmable, :rememberable, :timeoutable, :lockable, stretches: 15, pepper: 'abcdef', allow_unconfirmed_access_for: 5.days, remember_for: 7.days, timeout_in: 15.minutes, unlock_in: 10.days end class WithVali...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/mapping_test.rb
test/mapping_test.rb
# frozen_string_literal: true require 'test_helper' class FakeRequest < Struct.new(:path_info, :params) end class MappingTest < ActiveSupport::TestCase def fake_request(path, params = {}) FakeRequest.new(path, params) end test 'store options' do mapping = Devise.mappings[:user] assert_equal User, ...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/rails_test.rb
test/rails_test.rb
# frozen_string_literal: true require 'test_helper' class RailsTest < ActiveSupport::TestCase test 'correct initializer position' do initializer = Devise::Engine.initializers.detect { |i| i.name == 'devise.omniauth' } assert_equal :load_config_initializers, initializer.after assert_equal :build_middlewa...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/test_helper.rb
test/test_helper.rb
# frozen_string_literal: true ENV["RAILS_ENV"] = "test" DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym $:.unshift File.dirname(__FILE__) puts "\n==> Devise.orm = #{DEVISE_ORM.inspect}" require "rails_app/config/environment" require "rails/test_help" require "orm/#{DEVISE_ORM}" I18n.load_path.concat Dir["...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/delegator_test.rb
test/delegator_test.rb
# 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 r...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/models_test.rb
test/models_test.rb
# frozen_string_literal: true require 'test_helper' require 'test_models' class ActiveRecordTest < ActiveSupport::TestCase def include_module?(klass, mod) klass.devise_modules.include?(mod) && klass.included_modules.include?(Devise::Models::const_get(mod.to_s.classify)) end def assert_include_modules...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/parameter_sanitizer_test.rb
test/parameter_sanitizer_test.rb
# frozen_string_literal: true require 'test_helper' require 'devise/parameter_sanitizer' class ParameterSanitizerTest < ActiveSupport::TestCase def sanitizer(params) params = ActionController::Parameters.new(params) Devise::ParameterSanitizer.new(User, :user, params) end test 'permits the default param...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/support/assertions.rb
test/support/assertions.rb
# frozen_string_literal: true require 'active_support/test_case' class ActiveSupport::TestCase def assert_blank(assertion) assert assertion.blank? end def assert_present(assertion) assert assertion.present? end def assert_email_sent(address = nil, &block) assert_difference('ActionMailer::Base....
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/support/http_method_compatibility.rb
test/support/http_method_compatibility.rb
# frozen_string_literal: true module Devise class IntegrationTest < ActionDispatch::IntegrationTest end class ControllerTestCase < ActionController::TestCase end end
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/support/helpers.rb
test/support/helpers.rb
# frozen_string_literal: true require 'active_support/test_case' class ActiveSupport::TestCase def setup_mailer ActionMailer::Base.deliveries = [] end def store_translations(locale, translations, &block) # Calling 'available_locales' before storing the translations to ensure # that the I18n backend...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/support/integration.rb
test/support/integration.rb
# frozen_string_literal: true require 'action_dispatch/testing/integration' class ActionDispatch::IntegrationTest def warden request.env['warden'] end def create_user(options = {}) @user ||= begin user = User.create!( username: 'usertest', email: options[:email] || 'user@test.com'...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/support/webrat/matchers.rb
test/support/webrat/matchers.rb
# Monkey patch for Nokogiri changes - https://github.com/sparklemotion/nokogiri/issues/2469 module Webrat module Matchers class HaveSelector def query Nokogiri::CSS::Parser.new.parse(@expected.to_s).map do |ast| if ::Gem::Version.new(Nokogiri::VERSION) < ::Gem::Version.new('1.17.2') ...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/support/webrat/integrations/rails.rb
test/support/webrat/integrations/rails.rb
# frozen_string_literal: true require 'webrat/core/elements/form' require 'action_dispatch/testing/integration' module Webrat Form.class_eval do def self.parse_rails_request_params(params) Rack::Utils.parse_nested_query(params) end end module Logging # Avoid RAILS_DEFAULT_LOGGER deprecation w...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/support/action_controller/record_identifier.rb
test/support/action_controller/record_identifier.rb
# frozen_string_literal: true # Since webrat uses ActionController::RecordIdentifier class that was moved to # ActionView namespace in Rails 4.1+ unless defined?(ActionController::RecordIdentifier) require 'action_view/record_identifier' module ActionController RecordIdentifier = ActionView::RecordIdentifier...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/integration/mounted_engine_test.rb
test/integration/mounted_engine_test.rb
# frozen_string_literal: true require 'test_helper' module MyMountableEngine class Engine < ::Rails::Engine isolate_namespace MyMountableEngine end class TestsController < ActionController::Base def index render plain: 'Root test successful' end def inner_route render plain: 'Inner r...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/integration/trackable_test.rb
test/integration/trackable_test.rb
# frozen_string_literal: true require 'test_helper' class TrackableHooksTest < Devise::IntegrationTest test "trackable should not run model validations" do sign_in_as_user assert_not User.validations_performed end test "current and last sign in timestamps are updated on each sign in" do user = cre...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/integration/database_authenticatable_test.rb
test/integration/database_authenticatable_test.rb
# frozen_string_literal: true require 'test_helper' class DatabaseAuthenticationTest < Devise::IntegrationTest test 'sign in with email of different case should succeed when email is in the list of case insensitive keys' do create_user(email: 'Foo@Bar.com') sign_in_as_user do fill_in 'email', with: '...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/integration/timeoutable_test.rb
test/integration/timeoutable_test.rb
# frozen_string_literal: true require 'test_helper' class SessionTimeoutTest < Devise::IntegrationTest def last_request_at @controller.user_session['last_request_at'] end test 'set last request at in user session after each request' do sign_in_as_user assert_not_nil last_request_at @controlle...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/integration/omniauthable_test.rb
test/integration/omniauthable_test.rb
# frozen_string_literal: true require 'test_helper' class OmniauthableIntegrationTest < Devise::IntegrationTest FACEBOOK_INFO = { "id" => '12345', "link" => 'http://facebook.com/josevalim', "email" => 'user@example.com', "first_name" => 'Jose', "last_name" => 'Valim', "website" => 'http://b...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/integration/registerable_test.rb
test/integration/registerable_test.rb
# frozen_string_literal: true require 'test_helper' class RegistrationTest < Devise::IntegrationTest test 'a guest admin should be able to sign in successfully' do get new_admin_session_path click_link 'Sign up' assert_template 'registrations/new' fill_in 'email', with: 'new_user@test.com' fi...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/integration/lockable_test.rb
test/integration/lockable_test.rb
# frozen_string_literal: true require 'test_helper' class LockTest < Devise::IntegrationTest def visit_user_unlock_with_token(unlock_token) visit user_unlock_path(unlock_token: unlock_token) end def send_unlock_request user = create_user(locked: true) ActionMailer::Base.deliveries.clear visit...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/integration/rememberable_test.rb
test/integration/rememberable_test.rb
# frozen_string_literal: true require 'test_helper' class RememberMeTest < Devise::IntegrationTest def create_user_and_remember(add_to_token = '') user = create_user user.remember_me! raw_cookie = User.serialize_into_cookie(user).tap { |a| a[1] << add_to_token } cookies['remember_user_token'] = gene...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/integration/http_authenticatable_test.rb
test/integration/http_authenticatable_test.rb
# frozen_string_literal: true require 'test_helper' class HttpAuthenticationTest < Devise::IntegrationTest test 'sign in with HTTP should not run model validations' do sign_in_as_new_user_with_http assert_not User.validations_performed end test 'handles unverified requests gets rid of caches but conti...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/integration/authenticatable_test.rb
test/integration/authenticatable_test.rb
# frozen_string_literal: true require 'test_helper' class AuthenticationSanityTest < Devise::IntegrationTest test 'sign in should not run model validations' do sign_in_as_user assert_not User.validations_performed end test 'home should be accessible without sign in' do visit '/' assert_respons...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/integration/confirmable_test.rb
test/integration/confirmable_test.rb
# frozen_string_literal: true require 'test_helper' class ConfirmationTest < Devise::IntegrationTest def visit_user_confirmation_with_token(confirmation_token) visit user_confirmation_path(confirmation_token: confirmation_token) end def resend_confirmation user = create_user(confirm: false) Action...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/integration/recoverable_test.rb
test/integration/recoverable_test.rb
# frozen_string_literal: true require 'test_helper' class PasswordTest < Devise::IntegrationTest def visit_new_password_path visit new_user_session_path click_link 'Forgot your password?' end def request_forgot_password(&block) visit_new_password_path assert_response :success assert_not wa...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/helpers/devise_helper_test.rb
test/helpers/devise_helper_test.rb
# frozen_string_literal: true require 'test_helper' class DeviseHelperTest < Devise::IntegrationTest setup do model_labels = { models: { user: "the user" } } translations = { errors: { messages: { not_saved: { one: "Can't save %{resource} because of 1 error", other: "Can't save %{resou...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/controllers/helper_methods_test.rb
test/controllers/helper_methods_test.rb
# frozen_string_literal: true require 'test_helper' class ApiController < ActionController::Metal include Devise::Controllers::Helpers end class HelperMethodsTest < Devise::ControllerTestCase tests ApiController test 'includes Devise::Controllers::Helpers' do assert_includes @controller.class.ancestors, D...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/controllers/sessions_controller_test.rb
test/controllers/sessions_controller_test.rb
# frozen_string_literal: true require 'test_helper' class SessionsControllerTest < Devise::ControllerTestCase tests Devise::SessionsController include Devise::Test::ControllerHelpers test "#create doesn't raise unpermitted params when sign in fails" do begin subscriber = ActiveSupport::Notifications....
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/controllers/custom_registrations_controller_test.rb
test/controllers/custom_registrations_controller_test.rb
# frozen_string_literal: true require 'test_helper' class CustomRegistrationsControllerTest < Devise::ControllerTestCase tests Custom::RegistrationsController include Devise::Test::ControllerHelpers setup do request.env["devise.mapping"] = Devise.mappings[:user] @password = 'password' @user = crea...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/controllers/load_hooks_controller_test.rb
test/controllers/load_hooks_controller_test.rb
# frozen_string_literal: true require 'test_helper' class LoadHooksControllerTest < Devise::ControllerTestCase setup do ActiveSupport.on_load(:devise_controller) do define_method :defined_by_load_hook do puts 'I am defined dynamically by activesupport load hook' end end end teardown...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/controllers/inherited_controller_i18n_messages_test.rb
test/controllers/inherited_controller_i18n_messages_test.rb
# frozen_string_literal: true require 'test_helper' class SessionsInheritedController < Devise::SessionsController def test_i18n_scope set_flash_message(:notice, :signed_in) end end class AnotherInheritedController < SessionsInheritedController protected def translation_scope 'another' end end cl...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/controllers/helpers_test.rb
test/controllers/helpers_test.rb
# frozen_string_literal: true require 'test_helper' require 'ostruct' class ControllerAuthenticatableTest < Devise::ControllerTestCase tests ApplicationController def setup @mock_warden = OpenStruct.new @controller.request.env['warden'] = @mock_warden end test 'provide access to warden instance' do ...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/controllers/internal_helpers_test.rb
test/controllers/internal_helpers_test.rb
# frozen_string_literal: true require 'test_helper' class MyController < DeviseController end class HelpersTest < Devise::ControllerTestCase tests MyController def setup @mock_warden = OpenStruct.new @controller.request.env['warden'] = @mock_warden @controller.request.env['devise.mapping'] = Devise....
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/controllers/custom_strategy_test.rb
test/controllers/custom_strategy_test.rb
# frozen_string_literal: true require 'test_helper' require 'ostruct' require 'warden/strategies/base' require 'devise/test/controller_helpers' class CustomStrategyController < ActionController::Base def new warden.authenticate!(:custom_strategy) end end # These tests are to prove that a warden strategy can ...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/controllers/passwords_controller_test.rb
test/controllers/passwords_controller_test.rb
# frozen_string_literal: true require 'test_helper' class PasswordsControllerTest < Devise::ControllerTestCase tests Devise::PasswordsController include Devise::Test::ControllerHelpers setup do request.env["devise.mapping"] = Devise.mappings[:user] @user = create_user.tap(&:confirm) @raw = @user.s...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/controllers/url_helpers_test.rb
test/controllers/url_helpers_test.rb
# frozen_string_literal: true require 'test_helper' class RoutesTest < Devise::ControllerTestCase tests ApplicationController def assert_path_and_url(name, prepend_path = nil) @request.path = '/users/session' prepend_path = "#{prepend_path}_" if prepend_path # Resource param assert_equal @contro...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/test/controller_helpers_test.rb
test/test/controller_helpers_test.rb
# frozen_string_literal: true require 'test_helper' class TestControllerHelpersTest < Devise::ControllerTestCase tests UsersController include Devise::Test::ControllerHelpers test "redirects if attempting to access a page unauthenticated" do get :index assert_redirected_to new_user_session_path ass...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/test/integration_helpers_test.rb
test/test/integration_helpers_test.rb
# frozen_string_literal: true require 'test_helper' class TestIntegrationsHelpersTest < Devise::IntegrationTest include Devise::Test::IntegrationHelpers test '#sign_in signs in the resource directly' do sign_in(create_user) visit '/' assert warden.authenticated?(:user) end test '#sign_outs sign...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/models/trackable_test.rb
test/models/trackable_test.rb
# frozen_string_literal: true require 'test_helper' class TrackableTest < ActiveSupport::TestCase test 'required_fields should contain the fields that Devise uses' do assert_equal [ :current_sign_in_at, :current_sign_in_ip, :last_sign_in_at, :last_sign_in_ip, :sign_in_count ], ...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/models/serializable_test.rb
test/models/serializable_test.rb
# frozen_string_literal: true require 'test_helper' class SerializableTest < ActiveSupport::TestCase setup do @user = create_user end test 'should not include unsafe keys on JSON' do keys = from_json().keys.select{ |key| !key.include?("id") } assert_equal %w(created_at email facebook_token updated_...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/models/database_authenticatable_test.rb
test/models/database_authenticatable_test.rb
# frozen_string_literal: true require 'test_helper' require 'test_models' require 'digest/sha1' class DatabaseAuthenticatableTest < ActiveSupport::TestCase def setup setup_mailer end test 'should downcase case insensitive keys when saving' do # case_insensitive_keys is set to :email by default. ema...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/models/validatable_test.rb
test/models/validatable_test.rb
# encoding: UTF-8 # frozen_string_literal: true require 'test_helper' class ValidatableTest < ActiveSupport::TestCase test 'should require email to be set' do user = new_user(email: nil) assert user.invalid? assert user.errors[:email] assert user.errors.added?(:email, :blank) end test 'should r...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/models/timeoutable_test.rb
test/models/timeoutable_test.rb
# frozen_string_literal: true require 'test_helper' class TimeoutableTest < ActiveSupport::TestCase test 'should be expired' do assert new_user.timedout?(31.minutes.ago) end test 'should not be expired' do assert_not new_user.timedout?(29.minutes.ago) end test 'should not be expired when params i...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/models/omniauthable_test.rb
test/models/omniauthable_test.rb
# frozen_string_literal: true require 'test_helper' class OmniauthableTest < ActiveSupport::TestCase test 'required_fields should contain the fields that Devise uses' do assert_equal [], Devise::Models::Omniauthable.required_fields(User) end end
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/models/registerable_test.rb
test/models/registerable_test.rb
# frozen_string_literal: true require 'test_helper' class RegisterableTest < ActiveSupport::TestCase test 'required_fields should contain the fields that Devise uses' do assert_equal [], Devise::Models::Registerable.required_fields(User) end end
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/models/lockable_test.rb
test/models/lockable_test.rb
# frozen_string_literal: true require 'test_helper' class LockableTest < ActiveSupport::TestCase def setup setup_mailer end test "should respect maximum attempts configuration" do user = create_user user.confirm swap Devise, maximum_attempts: 2 do 2.times { user.valid_for_authentication?{...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/models/rememberable_test.rb
test/models/rememberable_test.rb
# frozen_string_literal: true require 'test_helper' class RememberableTest < ActiveSupport::TestCase def resource_class User end def create_resource create_user end test 'remember_me should not generate a new token if using salt' do user = create_user user.expects(:valid?).never user.r...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/models/authenticatable_test.rb
test/models/authenticatable_test.rb
# frozen_string_literal: true require 'test_helper' class AuthenticatableTest < ActiveSupport::TestCase test 'required_fields should be an empty array' do assert_equal [], Devise::Models::Validatable.required_fields(User) end test 'find_first_by_auth_conditions allows custom filtering parameters' do us...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/models/confirmable_test.rb
test/models/confirmable_test.rb
# frozen_string_literal: true require 'test_helper' class ConfirmableTest < ActiveSupport::TestCase def setup setup_mailer end test 'should set callbacks to send the mail' do if DEVISE_ORM == :active_record defined_callbacks = User._commit_callbacks.map(&:filter) assert_includes defined_ca...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/models/recoverable_test.rb
test/models/recoverable_test.rb
# frozen_string_literal: true require 'test_helper' class RecoverableTest < ActiveSupport::TestCase def setup setup_mailer end test 'should not generate reset password token after creating a record' do assert_nil new_user.reset_password_token end test 'should never generate the same reset passwor...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/generators/active_record_generator_test.rb
test/generators/active_record_generator_test.rb
# frozen_string_literal: true require "test_helper" if DEVISE_ORM == :active_record require "generators/active_record/devise_generator" class ActiveRecordGeneratorTest < Rails::Generators::TestCase tests ActiveRecord::Generators::DeviseGenerator destination File.expand_path("../../tmp", __FILE__) set...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/generators/devise_generator_test.rb
test/generators/devise_generator_test.rb
# frozen_string_literal: true require 'test_helper' require "generators/devise/devise_generator" class DeviseGeneratorTest < Rails::Generators::TestCase tests Devise::Generators::DeviseGenerator destination File.expand_path("../../tmp", __FILE__) setup do prepare_destination copy_routes end test ...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/generators/install_generator_test.rb
test/generators/install_generator_test.rb
# frozen_string_literal: true require "test_helper" class InstallGeneratorTest < Rails::Generators::TestCase tests Devise::Generators::InstallGenerator destination File.expand_path("../../tmp", __FILE__) setup :prepare_destination test "assert all files are properly created" do run_generator(["--orm=acti...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/generators/views_generator_test.rb
test/generators/views_generator_test.rb
# frozen_string_literal: true require "test_helper" class ViewsGeneratorTest < Rails::Generators::TestCase tests Devise::Generators::ViewsGenerator destination File.expand_path("../../tmp", __FILE__) setup :prepare_destination test "Assert all views are properly created with no params" do run_generator ...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/generators/controllers_generator_test.rb
test/generators/controllers_generator_test.rb
# frozen_string_literal: true require "test_helper" class ControllersGeneratorTest < Rails::Generators::TestCase tests Devise::Generators::ControllersGenerator destination File.expand_path("../../tmp", __FILE__) setup :prepare_destination test "Assert no controllers are created with no params" do capture...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/generators/mongoid_generator_test.rb
test/generators/mongoid_generator_test.rb
# frozen_string_literal: true require "test_helper" if DEVISE_ORM == :mongoid require "generators/mongoid/devise_generator" class MongoidGeneratorTest < Rails::Generators::TestCase tests Mongoid::Generators::DeviseGenerator destination File.expand_path("../../tmp", __FILE__) setup :prepare_destinatio...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/omniauth/config_test.rb
test/omniauth/config_test.rb
# frozen_string_literal: true require 'test_helper' class OmniAuthConfigTest < ActiveSupport::TestCase class MyStrategy include OmniAuth::Strategy end test 'strategy_name returns provider if no options given' do config = Devise::OmniAuth::Config.new :facebook, [{}] assert_equal :facebook, config.st...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/omniauth/url_helpers_test.rb
test/omniauth/url_helpers_test.rb
# frozen_string_literal: true require 'test_helper' class OmniAuthRoutesTest < ActionController::TestCase tests ApplicationController def assert_path(action, provider, with_param = true) # Resource param assert_equal @controller.send(action, :user, provider), @controller.send("user_#{pro...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false
heartcombo/devise
https://github.com/heartcombo/devise/blob/00a97782cb91104a72ea68d8f62ca8aa0e6eb101/test/orm/active_record.rb
test/orm/active_record.rb
# frozen_string_literal: true ActiveRecord::Migration.verbose = false ActiveRecord::Base.logger = Logger.new(nil) ActiveRecord::Base.include_root_in_json = true migrate_path = File.expand_path("../../rails_app/db/migrate/", __FILE__) if Devise::Test.rails71_and_up? ActiveRecord::MigrationContext.new(migrate_path).m...
ruby
MIT
00a97782cb91104a72ea68d8f62ca8aa0e6eb101
2026-01-04T15:37:27.393664Z
false