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 tests that generate URLs for attachments

Rafal Cymerysdbadb1a2eb00
diff --git a/common_spree_dependencies.rb b/common_spree_dependencies.rb
index 9d3fa71432..7ce55bb556 100644
--- a/common_spree_dependencies.rb
+++ b/common_spree_dependencies.rb
@@ -9,7 +9,7 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
actionmailer actionpack actionview activejob activemodel activerecord
activestorage activesupport railties
].each do |rails_gem|
- gem rails_gem, ENV.fetch('RAILS_VERSION', '~> 7.0.0'), require: false
+ gem rails_gem, ENV.fetch('RAILS_VERSION', '~> 7.1.0'), require: false
end
platforms :jruby do
@@ -38,7 +38,7 @@ group :test do
gem 'rspec-rails'
gem 'rspec-retry'
gem 'rspec_junit_formatter'
- gem 'rswag-specs', github: 'rswag/rswag'
+ gem 'rswag-specs'
gem 'jsonapi-rspec'
gem 'simplecov', '0.17.1'
gem 'webmock'
diff --git a/core/spec/models/spree/image_spec.rb b/core/spec/models/spree/image_spec.rb
index 5da7d45582..9947008f3b 100644
--- a/core/spec/models/spree/image_spec.rb
+++ b/core/spec/models/spree/image_spec.rb
@@ -30,6 +30,7 @@ describe Spree::Image, type: :model do
describe '#styles' do
it 'will return all styles for the image' do
spree_image.attachment.attach(io: image_file, filename: 'thinking-cat.jpg', content_type: 'image/jpeg')
+ spree_image.save!
res = spree_image.styles
expect(res.length).to eq described_class.styles.keys.length
@@ -39,6 +40,7 @@ describe Spree::Image, type: :model do
describe '#style' do
it 'will return style for the given name' do
spree_image.attachment.attach(io: image_file, filename: 'thinking-cat.jpg', content_type: 'image/jpeg')
+ spree_image.save!
styles = described_class.styles.keys
random_style_name = styles.sample
res = spree_image.style(random_style_name)
diff --git a/emails/spec/helpers/spree/mail_helper_spec.rb b/emails/spec/helpers/spree/mail_helper_spec.rb
index a342c5fef2..f19a94a66b 100644
--- a/emails/spec/helpers/spree/mail_helper_spec.rb
+++ b/emails/spec/helpers/spree/mail_helper_spec.rb
@@ -64,6 +64,7 @@ module Spree
before do
store.build_mailer_logo
store.mailer_logo.attachment.attach(io: logo_image, filename: 'spree_50.png', content_type: 'image/png')
+ store.mailer_logo.attachment.save!
@order = create(:order, store: store)
end
@@ -78,6 +79,7 @@ module Spree
before do
store.build_mailer_logo
store.mailer_logo.attachment.attach(io: logo_image, filename: 'mini.png', content_type: 'image/png')
+ store.mailer_logo.attachment.save!
end
it 'shows logo attached to current store' do