Fork me on GitHub
#pedestal
<
2019-02-16
>
TK12:02:41

And maybe an integration testing would be to compose "unit tests". for example - List resources: empty - Create resource: return resource - List resource: list with the created resource - Update the resource: return the updated resource ...and so on. Is this the idea of an integration testing?

ddeaguiar16:02:16

I think that’s consistent with integration testing. In my experience, the term integration testing has been used to describe end-to-end tests which exercise the system in the context of backing infrastructure/dependencies (i.e., real database, externally deployed services, etc…)

TK12:02:34

For the unit test, we could also use let to get the response and use it to multiple "assertions"

(let [response (response-for service
                             :post "/foo"
                             :headers {"Content-Type" "application/json"}
                             :body "{\"foo\":\"bar\"}")]
  (is (= 200 (:status response)))
  (is (= {"foo": "bar"} (:body response))))