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 flaky taxon sync_taxonomy_name test (#13550)

Damian Legawieccff6576d0873
diff --git a/core/spec/models/spree/taxon_spec.rb b/core/spec/models/spree/taxon_spec.rb
index 8f6d97cdd9..30e96c7814 100644
--- a/core/spec/models/spree/taxon_spec.rb
+++ b/core/spec/models/spree/taxon_spec.rb
@@ -317,20 +317,15 @@ describe Spree::Taxon, type: :model do
end
context 'when root taxon attribute other than name is updated' do
- it 'does not update the taxonomy' do
+ it 'does not update the taxonomy name' do
root_taxon = described_class.find_by(name: 'Soft Goods')
- Timecop.freeze do
- taxonomy_updated_at = taxonomy.updated_at.to_s
-
- expect {
- root_taxon.update!(permalink: 'something-else')
- root_taxon.reload
- taxonomy.reload
- }.not_to change { taxonomy.updated_at.to_s }.from(taxonomy_updated_at)
+ expect {
+ root_taxon.update!(permalink: 'something-else')
+ taxonomy.reload
+ }.not_to change { taxonomy.name }
- expect(root_taxon.permalink).to eql 'something-else'
- end
+ expect(root_taxon.permalink).to eql 'something-else'
end
end
end