1
0
Fork 0
mirror of https://github.com/edgurgel/httparrot synced 2025-04-06 00:32:34 -04:00
httparrot/test/cache_handler_test.exs
2014-06-24 21:35:13 +12:00

22 lines
555 B
Elixir

defmodule HTTParrot.CacheHandlerTest do
use ExUnit.Case
import :meck
import HTTParrot.CacheHandler
setup do
new HTTParrot.GeneralRequestInfo
new JSEX
on_exit fn -> unload end
:ok
end
test "returns prettified json with query values, headers, url and origin" do
expect(HTTParrot.GeneralRequestInfo, :retrieve, 1, {:info, :req2})
expect(JSEX, :encode!, [{[:info], :json}])
assert get_json(:req1, :state) == {:json, :req2, :state}
assert validate HTTParrot.GeneralRequestInfo
assert validate JSEX
end
end