-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
init(ex/skate/snapshot_serde): create deserialize function (#2897)
* init(ex/skate/snapshot_serde): create `deserialize` function * refactor(ex/detours): refactor `update_or_create_detour_for_user` to use Serde module
- Loading branch information
Showing
4 changed files
with
59 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -280,23 +280,21 @@ defmodule SkateWeb.DetoursControllerTest do | |
other_user = Skate.Settings.User.get_by_email("[email protected]") | ||
|
||
# Manually insert a detour by another user | ||
Detours.update_or_create_detour_for_user(other_user.id, 10, %{ | ||
state: %{ | ||
"context" => %{ | ||
"route" => %{ | ||
"name" => "23", | ||
"directionNames" => %{ | ||
"0" => "Outbound", | ||
"1" => "Inbound" | ||
} | ||
}, | ||
"routePattern" => %{ | ||
"headsign" => "Headsign", | ||
"directionId" => 0 | ||
}, | ||
"nearestIntersection" => "Street A & Avenue B", | ||
"uuid" => 10 | ||
} | ||
Detours.upsert_from_snapshot(other_user.id, %{ | ||
"context" => %{ | ||
"route" => %{ | ||
"name" => "23", | ||
"directionNames" => %{ | ||
"0" => "Outbound", | ||
"1" => "Inbound" | ||
} | ||
}, | ||
"routePattern" => %{ | ||
"headsign" => "Headsign", | ||
"directionId" => 0 | ||
}, | ||
"nearestIntersection" => "Street A & Avenue B", | ||
"uuid" => 10 | ||
} | ||
}) | ||
|
||
|