mirror of
https://github.com/edgurgel/httparrot
synced 2025-04-05 16:22:32 -04:00
20 lines
519 B
Elixir
20 lines
519 B
Elixir
defmodule HTTParrot.HeadersHandlerTest do
|
|
use ExUnit.Case
|
|
import :meck
|
|
import HTTParrot.HeadersHandler
|
|
|
|
setup do
|
|
new :cowboy_req
|
|
end
|
|
|
|
teardown do
|
|
unload :cowboy_req
|
|
end
|
|
|
|
test "returns prettified json with headers list" do
|
|
headers = [header1: "value 1", header2: "value 2"]
|
|
expect(:cowboy_req, :headers, 1, {headers, :req2})
|
|
assert get_json(:req1, :state) == {"{\"headers\":{\"header1\":\"value 1\",\"header2\":\"value 2\"}}", :req2, :state}
|
|
assert validate :cowboy_req
|
|
end
|
|
end
|