4 changed files with 45 additions and 60 deletions
@ -1,31 +0,0 @@ |
|||||||
(ns NoteHub.test.all |
|
||||||
(:use [NoteHub.storage] [clojure.test])) |
|
||||||
|
|
||||||
(def date [2012 06 03]) |
|
||||||
(def test-title "Some title.") |
|
||||||
(def test-note "This is a test note.") |
|
||||||
|
|
||||||
(testing "Storage" |
|
||||||
(testing "of correct note creation" |
|
||||||
(is (= (do |
|
||||||
(set-note date test-title test-note) |
|
||||||
(get-note date test-title)) |
|
||||||
test-note))) |
|
||||||
(testing "of the note access" |
|
||||||
(is (not= (get-note date test-title) "any text"))) |
|
||||||
(testing "of note existence" |
|
||||||
(is (note-exists? date test-title)) |
|
||||||
(is (not (do |
|
||||||
(delete-note date test-title) |
|
||||||
(note-exists? date test-title)))) |
|
||||||
(is (not (note-exists? [2013 06 03] test-title))) |
|
||||||
(is (not (note-exists? date "some title"))))) |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; to test |
|
||||||
; |
|
||||||
; crossover.lib |
|
||||||
; storage |
|
||||||
; pages |
|
||||||
; noir.util.test |
|
||||||
@ -0,0 +1,19 @@ |
|||||||
|
(ns NoteHub.test.views.pages |
||||||
|
(:use [NoteHub.views.pages] |
||||||
|
[noir.util.test] |
||||||
|
[clojure.test])) |
||||||
|
|
||||||
|
(deftest helper-functions |
||||||
|
(testing "Markdown generation" |
||||||
|
(is (= "<h1><em>hello</em> <strong>world</strong></h1><p>test <code>code</code></p>" |
||||||
|
(md-to-html "#_hello_ __world__\ntest `code`"))))) |
||||||
|
|
||||||
|
(deftest requests |
||||||
|
(testing "HTTP Statuses" |
||||||
|
(testing "of a wrong access" |
||||||
|
(has-status (send-request "/wrong-page") 404)) |
||||||
|
(testing "of corrupt note-post" |
||||||
|
(has-status (send-request [:post "/2012/06/04/wrong-title"]) 404) |
||||||
|
(has-status (send-request [:post "/post-note"]) 400)) |
||||||
|
(testing "valid accesses" |
||||||
|
(has-status (send-request "/") 200)))) |
||||||
Loading…
Reference in new issue