Skip to content

Commit

Permalink
tests: adds http in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaeldelboni committed Feb 27, 2024
1 parent a4d1301 commit 8b112bb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/codes/clj/docs/backend/controllers/document.clj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
(db/get-definition-by-id definition-id db-docs))

(defn search-by-fulltext
{:malli/schema [:=> [:cat :string :int schemas.types/DatalevinComponent]
{:malli/schema [:=> [:cat :string :int schemas.types/Components]
schemas.model.document/SearchResults]}
[search top {:keys [db-docs]}]
(db/search-by-fulltext search top db-docs))
21 changes: 20 additions & 1 deletion test/integration/codes/clj/docs/backend/document_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,23 @@
(match? {:status 404
:body "not found"}
(state-flow.server/request! {:method :get
:uri "/api/document/definition/golang/go/math/abs/0"})))))
:uri "/api/document/definition/golang/go/math/abs/0"})))

(flow "should return search results"
(match? {:status 200
:body [{:id "org.clojure/clojure/clojure.pprint/pprint-logical-block/0"
:name "pprint-logical-block"
:type "definition"
:doc #"^Execute the body as a pretty printing"}
{:id "org.clojure/clojure/clojure.pprint"
:name "clojure.pprint"
:type "namespace"
:doc #"^A Pretty Printer for Clojure"}]}
(state-flow.server/request! {:method :get
:uri "/api/document/search/?q=pprint"})))

(flow "should return empty search results"
(match? {:status 200
:body []}
(state-flow.server/request! {:method :get
:uri "/api/document/search/?q=golang"})))))

0 comments on commit 8b112bb

Please sign in to comment.