Skip to content

Commit

Permalink
Meilleurs tests du controlleur de ressource (#4200)
Browse files Browse the repository at this point in the history
Testons une resource GTFS avec des erreurs de validation.
  • Loading branch information
ptitfred authored Sep 19, 2024
1 parent 90b58ca commit f95d9a5
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,11 @@ defmodule TransportWeb.ResourceControllerTest do
insert(:multi_validation, %{
resource_history_id: resource_history_id,
validator: Transport.Validators.GTFSTransport.validator_name(),
result: %{},
result: %{
"NullDuration" => [%{"severity" => "Information"}],
"MissingCoordinates" => [%{"severity" => "Warning"}]
},
max_error: "Warning",
metadata: %DB.ResourceMetadata{
metadata: %{
"networks" => ["3CM", "RLV"],
Expand Down Expand Up @@ -392,8 +396,8 @@ defmodule TransportWeb.ResourceControllerTest do
assert content =~
~s{Validation effectuée en utilisant <a href="#{permanent_url}">le fichier GTFS en vigueur</a> le 28/10/2022 à 16h12 Europe/Paris}

# Features are displayed in a table
[
# Features are displayed in a table
{"table", [{"class", _}],
[
{"thead", [],
Expand All @@ -407,6 +411,19 @@ defmodule TransportWeb.ResourceControllerTest do
]}
]},
{"tbody", [], rows}
]},
# Issues are listed in a paginated table
{"table", [{"class", "table"}],
[
{"tr", [],
[
{"th", [], ["Type d'objet"]},
{"th", [], ["Identifiant"]},
{"th", [], ["Nom de l’objet"]},
{"th", [], ["Identifiant associé"]},
{"th", [], ["Détails"]}
]},
{"tr", [], _}
]}
] = content |> Floki.parse_document!() |> Floki.find("table")

Expand Down

0 comments on commit f95d9a5

Please sign in to comment.