Skip to content

Commit

Permalink
Add test for photo description
Browse files Browse the repository at this point in the history
  • Loading branch information
mveytsman committed Jun 27, 2024
1 parent f1d9194 commit 7137a87
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/bike_brigade_web/live/campaign_signup_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,16 @@ defmodule BikeBrigadeWeb.CampaignSignupLiveTest do
assert html =~ "a large burrito with all the fixings"
end

test "we see campaign photos if available", ctx do
test "we see campaign photos and description if available", ctx do
{:ok, live, html} = live(ctx.conn, ~p"/campaigns/signup/#{ctx.campaign.id}/")
refute html =~ "Delivery photos"

Delivery.update_program(ctx.program, %{photos: ["https://example.com/photo.jpg"]})
Delivery.update_program(ctx.program, %{photos: ["https://example.com/photo.jpg"], photo_description: "a typical meal"})

{:ok, live, html} = live(ctx.conn, ~p"/campaigns/signup/#{ctx.campaign.id}/")
assert html =~ "Delivery photos"
assert html =~ "https://example.com/photo.jpg"
assert html =~ "a typical meal"
end

test "Invalid route for campaign shows flash and redirects", ctx do
Expand Down

0 comments on commit 7137a87

Please sign in to comment.