@@ -7,16 +7,24 @@ defmodule PlatformWeb.GameControllerTest do
77 @ create_attrs % {
88 description: "some description" ,
99 featured: true ,
10+ slug: "some slug" ,
1011 thumbnail: "some thumbnail" ,
1112 title: "some title"
1213 }
1314 @ update_attrs % {
1415 description: "some updated description" ,
1516 featured: false ,
17+ slug: "some updated slug" ,
1618 thumbnail: "some updated thumbnail" ,
1719 title: "some updated title"
1820 }
19- @ invalid_attrs % { description: nil , featured: nil , thumbnail: nil , title: nil }
21+ @ invalid_attrs % {
22+ description: nil ,
23+ featured: nil ,
24+ slug: nil ,
25+ thumbnail: nil ,
26+ title: nil
27+ }
2028
2129 def fixture ( :game ) do
2230 { :ok , game } = Products . create_game ( @ create_attrs )
@@ -42,12 +50,13 @@ defmodule PlatformWeb.GameControllerTest do
4250 conn = get ( conn , Routes . game_path ( conn , :show , id ) )
4351
4452 assert % {
45- "id" => id ,
46- "description" => "some description" ,
47- "featured" => true ,
48- "thumbnail" => "some thumbnail" ,
49- "title" => "some title"
50- } = json_response ( conn , 200 ) [ "data" ]
53+ "id" => id ,
54+ "description" => "some description" ,
55+ "featured" => true ,
56+ "slug" => "some slug" ,
57+ "thumbnail" => "some thumbnail" ,
58+ "title" => "some title"
59+ } = json_response ( conn , 200 ) [ "data" ]
5160 end
5261
5362 test "renders errors when data is invalid" , % { conn: conn } do
@@ -66,12 +75,13 @@ defmodule PlatformWeb.GameControllerTest do
6675 conn = get ( conn , Routes . game_path ( conn , :show , id ) )
6776
6877 assert % {
69- "id" => id ,
70- "description" => "some updated description" ,
71- "featured" => false ,
72- "thumbnail" => "some updated thumbnail" ,
73- "title" => "some updated title"
74- } = json_response ( conn , 200 ) [ "data" ]
78+ "id" => id ,
79+ "description" => "some updated description" ,
80+ "featured" => false ,
81+ "slug" => "some updated slug" ,
82+ "thumbnail" => "some updated thumbnail" ,
83+ "title" => "some updated title"
84+ } = json_response ( conn , 200 ) [ "data" ]
7585 end
7686
7787 test "renders errors when data is invalid" , % { conn: conn , game: game } do
0 commit comments