Skip to content

Commit

Permalink
✨🥡 Marketplace: Product#description is markdown on Menu
Browse files Browse the repository at this point in the history
  • Loading branch information
zspencer committed Feb 22, 2024
1 parent 14d9f1c commit 0e47220
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/furniture/marketplace/menu/product_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


<div class="text-sm">
<%= description %>
<%== description_html %>
</div>

<div class="text-right mt-3">
Expand Down
16 changes: 14 additions & 2 deletions spec/furniture/marketplace/menu/product_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,24 @@

let(:component) { described_class.new(product:, cart:) }
let(:marketplace) { create(:marketplace) }
let(:cart) { create(:marketplace_cart, marketplace:) }
let(:product) { create(:marketplace_product, marketplace:) }
let(:cart) { marketplace.cart_for_shopper(shopper: create(:marketplace_shopper)) }
let(:product) { create(:marketplace_product, description: product_description, marketplace:) }
let(:product_description) do
<<~DESC.chomp
A delicious fritter made with love
Make sure to **eat it warm!**
DESC
end

it { is_expected.to have_content(vc_test_controller.view_context.humanized_money_with_symbol(product.price)) }
it { is_expected.to have_no_content("Serves") }

it "renders the description as markdown" do
expect(output).to have_css("p", text: "A delicious fritter made with love")
expect(output).to have_css("strong", text: "eat it warm!")
end

context "when the product has servings" do
let(:product) { create(:marketplace_product, marketplace:, servings: 2) }

Expand Down

0 comments on commit 0e47220

Please sign in to comment.