Sha256: fc5c1385edaa26f16747dd0c6407e92333266d2876800139454d1d6150a036b7

Contents?: true

Size: 1.96 KB

Versions: 9

Compression:

Stored size: 1.96 KB

Contents

require 'rspec/rails'
require 'factory_bot_rails'
require 'database_cleaner'
require 'faker'
require 'webmock/rspec'
require 'pry-rails'
# require 'capybara/rspec'

ActiveRecord::Migration.maintain_test_schema!

Dir.glob(File.expand_path('../support/*.rb', __FILE__)).each do |file|
  require file
end

# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config|
  # config.infer_spec_type_from_file_location!
  # rspec-expectations config goes here. You can use an alternate
  # assertion/expectation library such as wrong or the stdlib/minitest
  # assertions if you prefer.
  config.expect_with :rspec do |expectations|
    # This option will default to `true` in RSpec 4. It makes the `description`
    # and `failure_message` of custom matchers include text for helper methods
    # defined using `chain`, e.g.:
    #     be_bigger_than(2).and_smaller_than(4).description
    #     # => "be bigger than 2 and smaller than 4"
    # ...rather than:
    #     # => "be bigger than 2"
    expectations.include_chain_clauses_in_custom_matcher_descriptions = true
  end

  # rspec-mocks config goes here. You can use an alternate test double
  # library (such as bogus or mocha) by changing the `mock_with` option here.
  config.mock_with :rspec do |mocks|
    # Prevents you from mocking or stubbing a method that does not exist on
    # a real object. This is generally recommended, and will default to
    # `true` in RSpec 4.
    mocks.verify_partial_doubles = true
  end

  config.include FactoryBot::Syntax::Methods

  config.before(:suite) do
    DatabaseCleaner.clean_with(:truncation, except: %w(ar_internal_metadata))
  end

  config.before(:each) do
    DatabaseCleaner.strategy = :transaction
  end

  config.before(:each) do
    DatabaseCleaner.start
  end

  config.append_after(:each) do
    DatabaseCleaner.clean
  end

  config.use_transactional_fixtures = false

  config.infer_spec_type_from_file_location!

  config.filter_rails_from_backtrace!

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mautic-2.3.8 spec/spec_helper.rb
mautic-2.3.7 spec/spec_helper.rb
mautic-2.3.6 spec/spec_helper.rb
mautic-2.3.5 spec/spec_helper.rb
mautic-2.3.4 spec/spec_helper.rb
mautic-2.3.3 spec/spec_helper.rb
mautic-2.3.1 spec/spec_helper.rb
mautic-2.2.2 spec/spec_helper.rb
mautic-2.1.1 spec/spec_helper.rb