Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix merge conflicts.

Sebastian Palma343482afe7db
diff --cc api/spec/spec_helper.rb
index e6f9b52d37,de0635f8a0..9a6ff3ae65
--- a/api/spec/spec_helper.rb
+++ b/api/spec/spec_helper.rb
@@@ -74,12 -69,19 +74,10 @@@ RSpec.configure do |config
Spree::Api::Config[:requires_authentication] = true
- country = create(:country, name: 'United States of America', iso_name: 'UNITED STATES', iso: 'US', states_required: true)
- Spree::Config[:default_country_id] = country.id
-
- create(:store, default: true)
+ country = create(:country, name: 'United States of America', iso_name: 'UNITED STATES', iso: 'US', iso3: 'USA', states_required: true)
+ create(:store, default: true, default_country: country, default_currency: 'USD')
end
- # Force jobs to be executed in a synchronous way (see http://archive.today/xcb1E)
- config.around do |example|
- (ActiveJob::Base.descendants << ActiveJob::Base).each(&:disable_test_adapter)
- ActiveJob::Base.queue_adapter = :inline
- example.run
- (ActiveJob::Base.descendants << ActiveJob::Base).each { |a| a.enable_test_adapter(ActiveJob::QueueAdapters::TestAdapter.new) }
- ActiveJob::Base.queue_adapter = :test
- end
-
config.order = :random
Kernel.srand config.seed
end
diff --cc core/spec/spec_helper.rb
index bc938fa1fe,69f745ddcc..6b79fb2467
--- a/core/spec/spec_helper.rb
+++ b/core/spec/spec_helper.rb
@@@ -72,19 -88,12 +89,9 @@@ RSpec.configure do |config
config.include Spree::TestingSupport::Preferences
config.include Spree::TestingSupport::Kernel
- config.before(:each, :inline_jobs) do
- ActiveJob::Base.queue_adapter = :test
- end
-
- config.after(:each, :inline_jobs) do
- ActiveJob::Base.queue_adapter = :inline
+ config.before(:suite) do
+ # Clean out the database state before the tests run
+ DatabaseCleaner.clean_with(:truncation)
- # Force jobs to be executed in a synchronous way
- ActiveJob::Base.queue_adapter = :inline
- end
-
- config.before(:each, :job) do
- ActiveJob::Base.queue_adapter = :test
- end
-
- config.after(:each, :job) do
- ActiveJob::Base.queue_adapter = :inline
end
config.order = :random