# Configure Rails Environment ENV['RAILS_ENV'] = 'test' require File.expand_path('../dummy/config/environment.rb', __FILE__) require 'rspec/rails' require 'database_cleaner' require 'ffaker' require 'capybara/rspec' require 'pry' Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f } require 'spree/testing_support/factories' require 'spree/testing_support/controller_requests' require 'spree/testing_support/authorization_helpers' require 'spree/testing_support/url_helpers' require 'spree_paypal_express/factories' RSpec.configure do |config| config.include FactoryGirl::Syntax::Methods config.include Spree::TestingSupport::UrlHelpers config.include Spree::TestingSupport::AuthorizationHelpers::Controller config.mock_with :rspec config.color = true config.use_transactional_fixtures = false config.before :suite do DatabaseCleaner.strategy = :transaction DatabaseCleaner.clean_with :truncation end config.before do DatabaseCleaner.strategy = example.metadata[:js] ? :truncation : :transaction DatabaseCleaner.start end config.after do DatabaseCleaner.clean end config.fail_fast = ENV['FAIL_FAST'] || false end