ibdknox/noir — Issue #84: has-body and response/status don't play nicely together
Author: paulbutcher
Created: 2012-02-27 20:50:53+00:00
State: open

The following page definition and associated test work just fine:

```clojure
(defpage "/welcome1" []
(response/json "hello"))

(deftest test-welcome1
(-> (send-request "/welcome1")
(has-body "\"hello\"")))
```

But the following:

```clojure
(defpage "/welcome2" []
(response/status 201 (response/json "hello")))

(deftest test-welcome2
(-> (send-request "/welcome2")
(has-body "\"hello\"")))
```

Fails with:

```
FAIL in (test-welcome2) (test.clj:38)
expected: (= cont (get resp :body))
actual: (not (= "\"hello\"" {:headers {"Content-Type" "application/json"}, :body "\"hello\""}))
```

I can work around this:

```clojure
(deftest test-welcome2-fixed
(let [resp (send-request "/welcome2")]
(has-body (:body resp) "\"hello\"")))
```

but that's not exactly very nice.