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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Tests for Store Helper
Damian Legawiecf188158dbe02
diff --git a/frontend/spec/helpers/store_helper_spec.rb b/frontend/spec/helpers/store_helper_spec.rbindex 71c3aa5b11..7e62b7b91c 100644--- a/frontend/spec/helpers/store_helper_spec.rb+++ b/frontend/spec/helpers/store_helper_spec.rb@@ -2,20 +2,40 @@ require 'spec_helper'module Spreedescribe StoreHelper, type: :helper do+ let(:germany) { create(:country, name: 'Germany', iso: 'GR') }+ let(:eu_store) { create(:store, default_currency: 'EUR', default_locale: 'de', default_country: germany) }++ before do+ I18n.backend.store_translations(:de,+ spree: {+ i18n: {+ this_file_language: 'Deutsch (DE)'+ }+ })+ end+describe '#stores' do+ before { create_list(:store, 3) }+ it { expect(stores.count).to eq(Spree::Store.count) }+ it { expect(stores).to eq(Spree::Store.order(:id)) }enddescribe '#store_country_iso' do+ let(:store_with_default_country) { build(:store, default_country: germany) }+ it { expect(store_country_iso(eu_store)).to eq('gr') }+ it { expect(store_country_iso(Spree::Store.default)).to be_nil }enddescribe '#store_currency_symbol' do-+ it { expect(store_currency_symbol(Spree::Store.default)).to eq('$') }+ it { expect(store_currency_symbol(eu_store)).to eq('€') }enddescribe '#store_locale_name' do-+ it { expect(store_locale_name(Spree::Store.default)).to eq('English (US)') }+ it { expect(store_locale_name(eu_store)).to eq('Deutsch (DE)') }endendend