spec/spec_helper.rb in solidus_signifyd-1.0.1 vs spec/spec_helper.rb in solidus_signifyd-1.1.0

- old
+ new

@@ -36,21 +36,28 @@ config.filter_run focus: true config.run_all_when_everything_filtered = true config.use_transactional_fixtures = false + config.include RSpec::Rails::Matchers config.include FactoryGirl::Syntax::Methods # Ensure Suite is set to use transactions for speed. config.before :suite do DatabaseCleaner.strategy = :transaction DatabaseCleaner.clean_with :truncation end + # allow us to test various preference settings without cross contamination + config.before :each do + SpreeSignifyd::Config.reset + end + # Before each spec check if it is a Javascript test and switch between using database transactions or not where necessary. config.before :each do DatabaseCleaner.strategy = example.metadata[:js] ? :truncation : :transaction DatabaseCleaner.start + ActiveJob::Base.queue_adapter = :test allow(Signifyd::Case).to receive(:create).and_return( { code: 201, body: { investigationId: 123 } } ) end