diff --git a/admin/app/components/solidus_admin/orders/index/component.rb b/admin/app/components/solidus_admin/orders/index/component.rb index 25033a23738..2cb0a1ca935 100644 --- a/admin/app/components/solidus_admin/orders/index/component.rb +++ b/admin/app/components/solidus_admin/orders/index/component.rb @@ -138,7 +138,7 @@ def customer_column col: { class: "w-[400px]" }, header: :customer, data: ->(order) do - customer_email = order.user&.email + customer_email = order.email content_tag :div, String(customer_email) end } diff --git a/admin/spec/features/orders/index_spec.rb b/admin/spec/features/orders/index_spec.rb new file mode 100644 index 00000000000..77ee070d708 --- /dev/null +++ b/admin/spec/features/orders/index_spec.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe "Orders", type: :feature do + before { sign_in create(:admin_user, email: 'admin@example.com') } + + it "lists orders", :js do + create(:order, number: "R123456789", total: 19.99) + + visit "/admin/orders" + click_on "In Progress" + + expect(page).to have_content("admin@example.com") + end +end