Sha256: d266012b05707513c88bb49650fd48ce4ea9536c4a04c21aa8c82bf007aeb1d5

Contents?: true

Size: 1.8 KB

Versions: 41

Compression:

Stored size: 1.8 KB

Contents

require "codeclimate-test-reporter"
#require 'simplecov'

#SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  #SimpleCov::Formatter::HTMLFormatter,
  #CodeClimate::TestReporter::Formatter
#]

#SimpleCov.start 'rails'
CodeClimate::TestReporter.start

ENV["RAILS_ENV"] = "test"

require File.expand_path("../dummy/config/environment", __FILE__)
require "rails/test_help"
require "minitest/rails"

# To add Capybara feature tests add `gem "minitest-rails-capybara"`
# to the test group in the Gemfile and uncomment the following:
# require "minitest/rails/capybara"

# Uncomment for awesome colorful output
require "minitest/pride"

ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
ActionDispatch::IntegrationTest.fixture_path = File.expand_path("../fixtures", __FILE__)

# I hate the default reporter. Use ProgressReporter instead.
Minitest::Reporters.use! Minitest::Reporters::ProgressReporter.new

class ActiveSupport::TestCase
  ActiveRecord::Migration.check_pending!

  # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
  #
  # Note: You'll currently still have to declare fixtures explicitly in integration tests
  # -- they do not yet inherit this setting
  fixtures :all

  # Add more helper methods to be used by all tests here...

  def age_token(user, client_id)
    user.tokens[client_id]['updated_at'] = Time.now - (DeviseTokenAuth.batch_request_buffer_throttle + 10.seconds)
    user.save!
  end

  def expire_token(user, client_id)
    user.tokens[client_id]['expiry'] = (Time.now - (DeviseTokenAuth.token_lifespan.to_f + 10.seconds)).to_i
    user.save!
  end
end

class ActionController::TestCase
  include Devise::TestHelpers

  setup do
    @routes = Dummy::Application.routes
    @request.env['devise.mapping'] = Devise.mappings[:user]
  end
end

Version data entries

41 entries across 41 versions & 3 rubygems

Version Path
devise_token_auth-0.1.32.beta1 test/test_helper.rb
devise_token_auth-0.1.31 test/test_helper.rb
devise_token_auth-0.1.31.beta10 test/test_helper.rb
devise_token_auth-0.1.31.beta9 test/test_helper.rb
devise_token_auth-0.1.31.beta8 test/test_helper.rb
devise_token_auth-0.1.31.beta7 test/test_helper.rb
devise_token_auth-0.1.31.beta6 test/test_helper.rb
devise_token_auth-0.1.31.beta5 test/test_helper.rb
devise_token_auth-0.1.31.beta4 test/test_helper.rb
devise_token_auth-0.1.31.beta3 test/test_helper.rb
devise_token_auth-0.1.31.beta2 test/test_helper.rb
devise_token_auth-0.1.31.beta1 test/test_helper.rb
devise_token_auth-0.1.30 test/test_helper.rb
devise_token_auth-0.1.30.beta6 test/test_helper.rb
devise_token_auth-0.1.30.beta5 test/test_helper.rb
devise_token_auth-0.1.30.beta4 test/test_helper.rb
devise_token_auth-0.1.30.beta3 test/test_helper.rb
devise_token_auth-0.1.30.beta2 test/test_helper.rb
devise_token_auth-0.1.30.beta1 test/test_helper.rb
devise_token_auth-0.1.29 test/test_helper.rb