My Monster! It lives!

This commit is contained in:
Simon Brooke 2014-07-14 18:35:35 +01:00
parent 77cfb32bb2
commit ad0e992000
10 changed files with 262 additions and 68 deletions

13
test/mw_ui/test/rules.clj Normal file
View file

@ -0,0 +1,13 @@
(ns mw-ui.test.rules
(:use clojure.test
ring.mock.request
mw-ui.routes.rules))
;; Test file specifically to test the helper function in rules handler
(deftest test-rules-processor
(testing "Rules processor"
(let [request {:src "if state is new and altitude is less than 10 then state should be water"}
response (process-rules-request request)]
(is (= (:message response) "Successfully compiled 1 rules"))
(is (= (count (:rules response)) 1))
(is (= (:rule-text response) (:src request))))))