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 code reviews.

Matthew Kennedy460bd610de23
diff --git a/backend/app/helpers/spree/admin/base_helper.rb b/backend/app/helpers/spree/admin/base_helper.rb
index fec3072ee1..250cd0cedb 100644
--- a/backend/app/helpers/spree/admin/base_helper.rb
+++ b/backend/app/helpers/spree/admin/base_helper.rb
@@ -218,16 +218,6 @@ module Spree
end
end
- def stores_formatted_for_select
- formatted_stores = []
-
- @stores.each do |store|
- formatted_stores << ["#{store.name} (#{store.code})", store.id]
- end
-
- formatted_stores
- end
-
def select2_local_fallback
stripped_locale = I18n.locale.to_s.split('-').first
diff --git a/backend/app/helpers/spree/admin/stores_helper.rb b/backend/app/helpers/spree/admin/stores_helper.rb
index 72c64e4a8d..6ee8cfe9eb 100644
--- a/backend/app/helpers/spree/admin/stores_helper.rb
+++ b/backend/app/helpers/spree/admin/stores_helper.rb
@@ -4,6 +4,14 @@ module Spree
def selected_checkout_zone(store)
store&.checkout_zone || Spree::Zone.default_checkout_zone
end
+
+ def stores_formatted_for_select
+ formatted_stores = []
+
+ @stores.map { |store| formatted_stores << [store.unique_name, store.id] }
+
+ formatted_stores
+ end
end
end
end
diff --git a/backend/spec/features/admin/menus/index_menu_spec.rb b/backend/spec/features/admin/menus/index_menu_spec.rb
index ad5ae0459d..033d0be86b 100644
--- a/backend/spec/features/admin/menus/index_menu_spec.rb
+++ b/backend/spec/features/admin/menus/index_menu_spec.rb
@@ -14,10 +14,10 @@ describe 'Menus Index', type: :feature do
end
context 'when menus are present' do
- let!(:store_1) { create(:store, name: 'AbCd') }
- let!(:store_2) { create(:store, name: 'EfGh') }
- let!(:store_3) { create(:store, name: 'IjKl') }
- let!(:store_4) { create(:store, name: 'MnOp') }
+ let!(:store_1) { create(:store) }
+ let!(:store_2) { create(:store) }
+ let!(:store_3) { create(:store) }
+ let!(:store_4) { create(:store) }
let!(:main_menu) { create(:menu, name: 'Main Menu', store_id: store_1.id) }
let!(:main_menu_fr) { create(:menu, name: 'Main Menu FR', store_id: store_1.id, locale: 'fr') }
@@ -33,7 +33,7 @@ describe 'Menus Index', type: :feature do
visit spree.admin_menus_path
end
- it 'lists each menu with its store ' do
+ it 'lists each menu with stores' do
within_table('menusTable') do
expect(page).to have_text 'Main Menu'
expect(page).to have_text 'Footer Menu'
@@ -56,7 +56,7 @@ describe 'Menus Index', type: :feature do
expect(page).not_to have_css('.translation_missing', visible: :all)
end
- describe 'when filtering menus', js: true do
+ describe 'when filtering', js: true do
it 'is able to filter by name' do
click_on 'Filter'
fill_in 'Name', with: 'Main Menu FR'
@@ -75,7 +75,7 @@ describe 'Menus Index', type: :feature do
expect(page).not_to have_text 'Footer Menu'
end
- it 'is able to filter by menu location' do
+ it 'is able to filter by location' do
click_on 'Filter'
select2 'Footer', from: 'Location'
click_on 'Search'