Display special_instructions of order as emphasized text if present

+ update spec as well
This commit is contained in:
Jean-Baptiste Bellet
2023-03-03 11:04:57 +01:00
parent 2814b1f399
commit c34942dbf0
2 changed files with 15 additions and 0 deletions

View File

@@ -34,6 +34,10 @@
= @order.bill_address.zipcode
%div
= @order.bill_address.country
- if @order.special_instructions.present?
%br
%em
= @order.special_instructions
- if @order.shipping_method.description.present?
%div
.summary-subtitle

View File

@@ -793,6 +793,17 @@ describe "As a consumer, I want to checkout my order" do
create(:order_ready_for_confirmation, distributor: distributor)
}
describe "with an order with special instructions" do
before do
order.update_attribute(:special_instructions, "Please deliver on Tuesday")
visit checkout_step_path(:summary)
end
it "displays the special instructions" do
expect(page).to have_content "Please deliver on Tuesday"
end
end
describe "completing the checkout" do
it "keeps the distributor selected for the current user after completion" do
visit checkout_step_path(:summary)