Sha256: 5ed8d709d1b513735e564fa5ff04ea2664c6df7bd39832fd8757e6656f4ea4b2

Contents?: true

Size: 1.3 KB

Versions: 3

Compression:

Stored size: 1.3 KB

Contents

ENV["RAILS_ENV"] ||= "test"

require "rails/all"
require "dummy/application"

require "clearance/rspec"
require "factory_bot_rails"
require "rspec/rails"
require "shoulda-matchers"
require "timecop"

Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }

Dummy::Application.initialize!

RSpec.configure do |config|
  config.include FactoryBot::Syntax::Methods
  config.infer_spec_type_from_file_location!
  config.order = :random
  config.use_transactional_fixtures = true

  config.expect_with :rspec do |expectations|
    expectations.syntax = :expect
  end

  config.mock_with :rspec do |mocks|
    mocks.syntax = :expect
  end

  config.before { restore_default_warning_free_config }

  if Rails::VERSION::MAJOR >= 5
    require 'rails-controller-testing'
    config.include Rails::Controller::Testing::TestProcess
    config.include Rails::Controller::Testing::TemplateAssertions
    config.include Rails::Controller::Testing::Integration
  end
end

Shoulda::Matchers.configure do |config|
  config.integrate do |with|
    with.test_framework :rspec
    with.library :action_controller
    with.library :active_model
    with.library :active_record
  end
end

def restore_default_warning_free_config
  Clearance.configuration = nil
  Clearance.configure { |config| config.rotate_csrf_on_sign_in = true }
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
clearance-2.0.0.beta1 spec/spec_helper.rb
clearance-1.17.0 spec/spec_helper.rb
clearance-1.16.2 spec/spec_helper.rb