diff --git a/test/httparrot_test.exs b/test/httparrot_test.exs
new file mode 100644
index 0000000..f393498
--- /dev/null
+++ b/test/httparrot_test.exs
@@ -0,0 +1,25 @@
+defmodule HTTParrotTest do
+ use ExUnit.Case
+ import :meck
+ import HTTParrot
+
+ setup do
+ new :cowboy_req
+ end
+
+ teardown do
+ unload :cowboy_req
+ end
+
+ test "'prettify_json' prettifies body response if it's a JSON" do
+ expect(:cowboy_req, :reply, [{[:status, [{"content-length", '14'}], "{\n \"a\": \"b\"\n}", :req1], {:ok, :req2}}])
+ assert prettify_json(:status, [{"content-length", '12'}], "{\"a\":\"b\"}", :req1) == :req2
+ assert validate :cowboy_req
+ end
+
+ test "'prettify_json' does nothing if body is not a JSON" do
+ expect(:cowboy_req, :reply, [{[:status, :headers, "", :req1], {:ok, :req2}}])
+ assert prettify_json(:status, :headers, "", :req1) == :req2
+ assert validate :cowboy_req
+ end
+end