Sha256: e2d905e668cca99b16b42680e99777274adfad752be790ef0c73662d12e6b706

Contents?: true

Size: 920 Bytes

Versions: 47

Compression:

Stored size: 920 Bytes

Contents

require File.expand_path('../boot', __FILE__)

require 'rails/all'

Bundler.require(:default, Rails.env) if defined?(Bundler)

require 'castronaut'
class TestAdapter
  def self.reset_valid_users!
    @@valid_users = {
      "joeuser" => "joepassword"
    }
  end
  reset_valid_users!

  def self.register_valid_user(username, password)
    @@valid_users[username] = password
  end
  
  def self.authenticate(username, password)
    error_message = if @@valid_users[username] == password
      nil
    else
      "Invalid password"
    end
    
    Castronaut::AuthenticationResult.new(username, error_message)
  end  
end

Castronaut::Adapters.register("test_adapter", TestAdapter)
Castronaut.config = Castronaut::Configuration.load(File.expand_path(File.join(File.dirname(__FILE__), "castronaut.yml")))

module Scenario
  class Application < Rails::Application
    config.active_support.deprecation = :stderr
  end
end

Version data entries

47 entries across 47 versions & 3 rubygems

Version Path
devise_cas_authenticatable-1.10.4 spec/scenario/config/application.rb
devise_cas_authenticatable-1.10.3 spec/scenario/config/application.rb
devise_cas_authenticatable-1.10.2 spec/scenario/config/application.rb
devise_cas_authenticatable-1.10.1 spec/scenario/config/application.rb
devise_cas_authenticatable-1.10.0 spec/scenario/config/application.rb
devise_cas_authenticatable-1.9.2 spec/scenario/config/application.rb
devise_cas_authenticatable-1.9.1 spec/scenario/config/application.rb
devise_cas_authenticatable-1.9.0 spec/scenario/config/application.rb
devise_cas_authenticatable-1.8.0 spec/scenario/config/application.rb
devise_cas_authenticatable-1.7.1 spec/scenario/config/application.rb
devise_cas_authenticatable-1.7.0 spec/scenario/config/application.rb
devise_cas_authenticatable-1.6.1 spec/scenario/config/application.rb
devise_cas_authenticatable-1.6.0 spec/scenario/config/application.rb
devise_cas_authenticatable-1.5.0 spec/scenario/config/application.rb
devise_cas_authenticatable-1.4.1 spec/scenario/config/application.rb
devise_cas_authenticatable-1.4.0 spec/scenario/config/application.rb
devise_cas_authenticatable-1.3.8 spec/scenario/config/application.rb
devise_cas_authenticatable-1.3.7 spec/scenario/config/application.rb
devise_cas_authenticatable-1.0.1 spec/scenario/config/application.rb
devise_cas_authenticatable-1.3.6 spec/scenario/config/application.rb