Sha256: 8ba44ae9f64fc2b2e80a913862672611114a9a944b6f5ab1c229a388b196b6cf
Contents?: true
Size: 1.44 KB
Versions: 6
Compression:
Stored size: 1.44 KB
Contents
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__) # I hate the default reporter. Use ProgressReporter instead. Minitest::Reporters.use! Minitest::Reporters::ProgressReporter.new class ActiveSupport::TestCase ActiveRecord::Migration.check_pending! include Devise::TestHelpers # 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... setup do @routes = DeviseTokenAuth::Engine.routes end before do @request.env["devise.mapping"] = Devise.mappings[:user] end 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) user.save end end
Version data entries
6 entries across 6 versions & 1 rubygems