Sha256: 9815778eeb5214c5ffdf5a4f7b4fc51d2ef83442be689355ffa02769d26539ff

Contents?: true

Size: 1.8 KB

Versions: 2

Compression:

Stored size: 1.8 KB

Contents

# This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# Require this file using `require "spec_helper"` to ensure that it is only
# loaded once.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration

$LOAD_PATH.unshift(File.dirname(__FILE__))
ENV['RAILS_ENV'] ||= 'test'

require File.expand_path("../dummy/config/environment.rb",  __FILE__)
require 'rspec/rails'
require 'shoulda-matchers'
require 'capybara/rails'
require 'capybara/rspec'
require 'capybara/webkit'
require 'database_cleaner'
require 'factory_bot_rails'

Capybara.default_selector = :css
Capybara.javascript_driver = :webkit
Rails.backtrace_cleaner.remove_silencers!

# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

DatabaseCleaner.strategy = :truncation

RSpec.configure do |config|
  config.run_all_when_everything_filtered = true
  config.expect_with(:rspec) { |c| c.syntax = :should }
  config.mock_with :rspec
  config.infer_base_class_for_anonymous_controllers = false


  # Run specs in random order to surface order dependencies. If you find an
  # order dependency and want to debug it, you can fix the order by providing
  # the seed, which is printed after each run.
  #     --seed 1234
  config.order = 'random'

  config.include Warden::Test::Helpers, type: :feature
  config.include FactoryBot::Syntax::Methods # Defines #create as FactoryBot.create

  config.before :each do
    DatabaseCleaner.clean_with :truncation
  end

  config.after(:each, :type => :feature) do
    DatabaseCleaner.clean       # Truncate the database
    Capybara.reset_sessions!    # Forget the (simulated) browser state
    Capybara.use_default_driver # Revert Capybara.current_driver to Capybara.default_driver
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rs-active_admin-state_machine-0.2.1 spec/spec_helper.rb
rs-active_admin-state_machine-0.2.0 spec/spec_helper.rb