Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineAugusti authored Jan 18, 2024
1 parent e94a9eb commit f5ecf70
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ defmodule Transport.TransportWeb.DiscussionsLiveTest do
end

test "renders even if data.gouv is down", %{conn: conn} do
dataset = insert(:dataset, datagouv_id: datagouv_id = Ecto.UUID.generate(), organization: "producer_org")
dataset = insert(:dataset, datagouv_id: datagouv_id = Ecto.UUID.generate(), organization_id: org_id = Ecto.UUID.generate())

# in case of request failure, the function returns an empty list.
Datagouvfr.Client.Discussions.Mock |> expect(:get, 1, fn ^datagouv_id -> [] end)
Datagouvfr.Client.Organization.Mock |> expect(:get, 1, fn _id, _opts -> {:error, "error reason"} end)
Datagouvfr.Client.Organization.Mock |> expect(:get, 1, fn ^org_id, _opts -> {:error, "error reason"} end)

assert {:ok, view, _html} =
live_isolated(conn, TransportWeb.DiscussionsLive,
Expand Down

0 comments on commit f5ecf70

Please sign in to comment.