Skip to content

Commit

Permalink
test(ex/skate/ors): Update test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
firestack committed Nov 26, 2024
1 parent f831d30 commit ae88499
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 16 deletions.
4 changes: 2 additions & 2 deletions lib/skate/open_route_service_api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ defmodule Skate.OpenRouteServiceAPI do
],
directions: [
%{
instruction: "Turn right onto 1st Avenue"
instruction: "R - 1st Avenue"
},
%{
instruction: "Turn left onto 2nd Place"
instruction: "L - 2nd Place"
}
]
}
Expand Down
10 changes: 8 additions & 2 deletions test/skate/open_route_service_api_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,18 @@ defmodule Skate.OpenRouteServiceAPITest do
"steps" => [
%{
"instruction" => "not-in-results",
"name" => "not-in-results",
# Depart
"type" => 11
},
%{
"instruction" => "1",
"name" => "1",
"type" => 1
},
%{
"instruction" => "not-in-results",
"name" => "not-in-results",
# Goal
"type" => 10
}
Expand All @@ -102,16 +105,19 @@ defmodule Skate.OpenRouteServiceAPITest do
"steps" => [
%{
"instruction" => "not-in-results",
"name" => "not-in-results",
# Depart
"type" => 11
},
%{
"instruction" => "not-in-results",
"name" => "not-in-results",
# Straight
"type" => 6
},
%{
"instruction" => "2",
"name" => "2",
"type" => 0
}
]
Expand All @@ -124,8 +130,8 @@ defmodule Skate.OpenRouteServiceAPITest do
assert {:ok,
%DirectionsResponse{
directions: [
%{instruction: "1"},
%{instruction: "2"}
%{instruction: "R - 1"},
%{instruction: "L - 2"}
]
}} =
Skate.OpenRouteServiceAPI.directions([
Expand Down
15 changes: 9 additions & 6 deletions test/skate_web/controllers/detour_route_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,22 @@ defmodule SkateWeb.DetourRouteControllerTest do
"steps" => [
%{
"instruction" => "1",
"type" => 1
"type" => 1,
"name" => "First Street"
},
%{
"instruction" => "2",
"type" => 0
"type" => 0,
"name" => "Second Street"
}
]
},
%{
"steps" => [
%{
"instruction" => "3",
"type" => 2
"type" => 2,
"name" => "Third Street"
}
]
}
Expand All @@ -94,9 +97,9 @@ defmodule SkateWeb.DetourRouteControllerTest do
assert %{
"data" => %{
"directions" => [
%{"instruction" => "1"},
%{"instruction" => "2"},
%{"instruction" => "3"}
%{"instruction" => "R - First Street"},
%{"instruction" => "L - Second Street"},
%{"instruction" => "Sharp L - Third Street"}
]
}
} =
Expand Down
15 changes: 9 additions & 6 deletions test/skate_web/controllers/detours_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -786,19 +786,22 @@ defmodule SkateWeb.DetoursControllerTest do
"steps" => [
%{
"instruction" => "1",
"type" => 1
"type" => 1,
"name" => "1"
},
%{
"instruction" => "2",
"type" => 0
"type" => 0,
"name" => "2"
}
]
},
%{
"steps" => [
%{
"instruction" => "3",
"type" => 2
"type" => 2,
"name" => "3"
}
]
}
Expand Down Expand Up @@ -836,9 +839,9 @@ defmodule SkateWeb.DetoursControllerTest do
"data" => %{
"detour_shape" => %{
"directions" => [
%{"instruction" => "1"},
%{"instruction" => "2"},
%{"instruction" => "3"}
%{"instruction" => "R - 1"},
%{"instruction" => "L - 2"},
%{"instruction" => "Sharp L - 3"}
]
}
}
Expand Down

0 comments on commit ae88499

Please sign in to comment.