Skip to content

Commit 6e748c3

Browse files
committed
add router test
1 parent c66815a commit 6e748c3

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/phoenix/sync/router_test.exs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,29 @@ defmodule Phoenix.Sync.RouterTest do
137137
] = Jason.decode!(resp.resp_body)
138138
end
139139

140+
@tag table: {
141+
"todos",
142+
[
143+
"id int8 not null primary key generated always as identity",
144+
"title text",
145+
"completed boolean default false"
146+
]
147+
}
148+
@tag data: {"todos", ["title"], [["one"], ["two"], ["three"]]}
149+
150+
test "returns a correct content-type header", _ctx do
151+
resp =
152+
Phoenix.ConnTest.build_conn()
153+
|> Phoenix.ConnTest.get("/sync/things-to-do", %{offset: "-1"})
154+
155+
assert resp.status == 200
156+
assert Plug.Conn.get_resp_header(resp, "electric-offset") == ["0_0"]
157+
158+
assert Plug.Conn.get_resp_header(resp, "content-type") == [
159+
"application/json; charset=utf-8"
160+
]
161+
end
162+
140163
@tag table: {
141164
"ideas",
142165
[

0 commit comments

Comments
 (0)