1
0
Fork 0
mirror of https://github.com/edgurgel/httparrot synced 2025-04-05 16:22:32 -04:00
httparrot/test/cache_handler_test.exs
Eduardo Gurgel 44c7c9b69b Add /cache
2014-05-02 21:48:21 +12:00

25 lines
595 B
Elixir

defmodule HTTParrot.CacheHandlerTest do
use ExUnit.Case
import :meck
import HTTParrot.CacheHandler
setup do
new HTTParrot.GeneralRequestInfo
new JSEX
end
teardown do
unload HTTParrot.GeneralRequestInfo
unload JSEX
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