Sha256: 7856911fecdf7a5f895277f7be259aa03a847b1ee1b71716ba3f7478d27b3dfd

Contents?: true

Size: 1.47 KB

Versions: 2

Compression:

Stored size: 1.47 KB

Contents

require 'simplecov'
SimpleCov.start 'rails'

ENV["RAILS_ENV"] = "test"

require File.expand_path("../dummy/config/environment.rb",  __FILE__)

require 'rspec/rails'
require 'rspec/active_model/mocks'
require 'capybara/rspec'
require 'capybara/rails'
require 'capybara/poltergeist'
require 'capybara-screenshot/rspec'
require 'database_cleaner'
require 'ffaker'
require 'rspec/active_model/mocks'

Dir[File.join(File.dirname(__FILE__), "support", "**", "*.rb")].each { |f| require f }

require 'spree/testing_support/factories'
require 'spree/testing_support/order_walkthrough'
require 'spree/testing_support/preferences'
require 'spree/testing_support/capybara_ext'

FactoryBot.find_definitions

RSpec.configure do |config|
  config.infer_spec_type_from_file_location!
  config.mock_with :rspec do |mock|
    mock.syntax = [:should, :expect]
  end
  config.raise_errors_for_deprecations!
  config.use_transactional_fixtures = false
  #config.filter_run focus: true
  #config.filter_run_excluding slow: true

  config.include FactoryBot::Syntax::Methods
  config.include Spree::TestingSupport::Preferences

  config.before :suite do
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with :truncation
  end

  config.before do
    DatabaseCleaner.strategy = RSpec.current_example.metadata[:js] ? :truncation : :transaction
    DatabaseCleaner.start
    reset_spree_preferences
  end

  config.after do
    DatabaseCleaner.clean
  end

  Capybara.javascript_driver = :poltergeist
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_gateway-3.3.3 spec/spec_helper.rb
spree_gateway-3.3.2 spec/spec_helper.rb