@@ -3,7 +3,6 @@ defmodule GitHubWebhookTest do
33 use Plug.Test
44
55 @ test_body % { "hello" => "world" }
6- @ test_body_serialized Jason . encode! ( @ test_body )
76
87 # Demo plug with basic auth and a simple index action
98 defmodule DemoPlug do
@@ -40,7 +39,7 @@ defmodule GitHubWebhookTest do
4039 |> DemoPlug . call ( [ ] )
4140
4241 assert conn . status == 200
43- assert Process . get ( :payload ) == @ test_body_serialized
42+ assert Process . get ( :payload ) == @ test_body
4443 assert ! Process . get ( :next_in_chain_called )
4544 end
4645
@@ -60,7 +59,7 @@ defmodule GitHubWebhookTest do
6059 |> DemoPlug . call ( [ ] )
6160
6261 assert conn . status == 200
63- assert Process . get ( :payload ) == @ test_body_serialized
62+ assert Process . get ( :payload ) == @ test_body
6463 end
6564
6665 test "when path does not match, skips this plug and proceeds to next one" do
@@ -96,7 +95,7 @@ defmodule GitHubWebhookTest do
9695 |> DemoPlugParamPresendence . call ( [ ] )
9796
9897 assert conn . status == 200
99- assert Process . get ( :payload ) == @ test_body_serialized
98+ assert Process . get ( :payload ) == @ test_body
10099 end
101100
102101 test "when secret is not set in params, it uses application setting" do
@@ -118,7 +117,7 @@ defmodule GitHubWebhookTest do
118117 |> DemoPlugApplicationSecret . call ( [ ] )
119118
120119 assert conn . status == 200
121- assert Process . get ( :payload ) == @ test_body_serialized
120+ assert Process . get ( :payload ) == @ test_body
122121 end
123122
124123 test "when secret is not set in params or Application setting, it assumes an empty secret" do
@@ -140,7 +139,7 @@ defmodule GitHubWebhookTest do
140139 |> DemoPlugNoSecret . call ( [ ] )
141140
142141 assert conn . status == 200
143- assert Process . get ( :payload ) == @ test_body_serialized
142+ assert Process . get ( :payload ) == @ test_body
144143 end
145144
146145 defp gh_webhook_request ( body \\ % { "hello" => "world" } , secret \\ "secret" ) do
0 commit comments