Skip to content

Commit

Permalink
Add Plug.Conn.Status.code/1 test for integer status (#1229)
Browse files Browse the repository at this point in the history
  • Loading branch information
thymusvulgaris authored Jun 21, 2024
1 parent cc535b1 commit 872f079
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/plug/conn/status_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ defmodule Plug.Conn.StatusTest do

alias Plug.Conn.Status

test "code/1 when given a numeric status code, returns the same numeric status code" do
assert Status.code(200) == 200
assert Status.code(203) == 203
assert Status.code(404) == 404
end

test "code for built-in statuses the numeric code" do
assert Status.code(:ok) == 200
assert Status.code(:non_authoritative_information) == 203
Expand Down

0 comments on commit 872f079

Please sign in to comment.