Skip to content

Commit b1e1502

Browse files
committed
update view test...still having problem with dates
1 parent 62d2998 commit b1e1502

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

config/config.exs

+2-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ config :code_corps, :processor, CodeCorps.Processor.Async
8888
config :code_corps, password_reset_timeout: 3600
8989

9090
config :jsonapi,
91-
remove_links: true
91+
remove_links: true,
92+
underscore_to_dash: true
9293

9394
# Import environment specific config. This must remain at the bottom
9495
# of this file so it overrides the configuration defined above.

test/lib/code_corps_web/views/task_list_view_test.exs

+13-14
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ defmodule CodeCorpsWeb.TaskListViewTest do
1010
rendered_json = render(CodeCorpsWeb.TaskListView, "show.json-api", %{data: task_list, conn: %Plug.Conn{}, params: task_list.id})
1111

1212
expected_json = %{
13-
"data" => %{
14-
"attributes" => %{
13+
:data => %{
14+
attributes: %{
1515
"done" => task_list.done,
1616
"inbox" => task_list.inbox,
1717
"name" => task_list.name,
@@ -20,26 +20,25 @@ defmodule CodeCorpsWeb.TaskListViewTest do
2020
"inserted-at" => task_list.inserted_at,
2121
"updated-at" => task_list.updated_at,
2222
},
23-
"id" => task_list.id |> Integer.to_string,
24-
"relationships" => %{
23+
id: task_list.id |> Integer.to_string,
24+
relationships: %{
2525
"project" => %{
26-
"data" => %{
27-
"id" => task_list.project_id |> Integer.to_string,
28-
"type" => "project"
26+
:data => %{
27+
id: task_list.project_id |> Integer.to_string,
28+
type: "project"
2929
}
3030
},
3131
"tasks" => %{
32-
"data" => [%{
33-
"id" => task.id |> Integer.to_string,
34-
"type" => "task"
32+
:data => [%{
33+
id: task.id |> Integer.to_string,
34+
type: "task"
3535
}]
3636
}
3737
},
38-
"type" => "task-list",
38+
type: "task-list",
3939
},
40-
"jsonapi" => %{
41-
"version" => "1.0"
42-
}
40+
:included => [],
41+
:links => %{}
4342
}
4443

4544
assert rendered_json == expected_json

0 commit comments

Comments
 (0)