Functional testing library for compojure applications
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/compojure_func
test/compojure_func
.gitignore
LICENSE
README.md
project.clj

README.md

compojure-func

A Clojure library for functional testing Compojure apps.

Usage

(ns myapp.test
  (:require [myapp.web :as web]
            [compojure-func]))

(def app web/handler)

(deftest home-page-test

  (testing "Should return HTTP success"
    (with-app app
	  (assert-response :get "/" 200)))

  (testing "Homepage should contain \"Hello world\""
    (with-app app
	  (assert-contains :get "/" "Hello world"))))

(deftest private-page-test
  (testing "Should return HTTP not found when not logged in"
    (with-app app
	  (assert-response :get "/private" 404))))

License

Copyright © 2014 FIXME

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.