short urls added; landing merged with readme.md
This commit is contained in:
@@ -4,9 +4,23 @@
|
||||
(def date [2012 06 03])
|
||||
(def test-title "Some title.")
|
||||
(def test-note "This is a test note.")
|
||||
(def metadata {:year 2012,
|
||||
:month 6,
|
||||
:day 23,
|
||||
:title test-title,
|
||||
:theme "dark",
|
||||
:header-font "Anton"})
|
||||
|
||||
|
||||
(deftest storage
|
||||
(testing "Storage"
|
||||
(testing "of short-url mechanism"
|
||||
(let [url (create-short-url metadata)]
|
||||
(is (short-url-exists? url))
|
||||
(is (= metadata (resolve-url url)))
|
||||
(is (not (do
|
||||
(delete-short-url url)
|
||||
(short-url-exists? url))))))
|
||||
(testing "of correct note creation"
|
||||
(is (= (do
|
||||
(set-note date test-title test-note)
|
||||
|
||||
@@ -20,14 +20,6 @@
|
||||
|
||||
(is (= (url 2010 05 06 "test-title" "export") "/2010/5/6/test-title/export"))
|
||||
|
||||
(is (= (url 2010 05 06 "test-title" "export" {"theme" "dark"}) "/2010/5/6/test-title/export?theme=dark"))
|
||||
|
||||
(is (= (url 2010 05 06 "test-title" "export" {:theme "dark"}) "/2010/5/6/test-title/export?theme=dark"))
|
||||
|
||||
(is (= (url 2010 05 06 "test-title" "export" {:theme :dark}) "/2010/5/6/test-title/export?theme=dark"))
|
||||
|
||||
(is (= (url :local 2010 05 06 "test-title" "export" {:theme :dark}) "2010/5/6/test-title/export?theme=dark"))
|
||||
|
||||
(deftest testing-fixture
|
||||
(testing "Was a not created?"
|
||||
(is (= (get-note date test-title) test-note))
|
||||
@@ -73,9 +65,8 @@
|
||||
(testing "of corrupt note-post"
|
||||
(is (has-status (send-request [:post "/post-note"]) 400)))
|
||||
(testing "valid accesses"
|
||||
(is (has-status (send-request "/new") 200))
|
||||
(is (has-status (send-request (url 2012 6 3 "some-title")) 200))
|
||||
(is (has-status (send-request (url 2012 6 3 "some-title" "export")) 200))
|
||||
(is (has-status (send-request (url 2012 6 3 "some-title" "stat")) 200))
|
||||
(is (has-status (send-request (url 2012 6 3 "some-title")) 200))
|
||||
(is (has-status (send-request "/") 200)))))
|
||||
;(is (has-status (send-request "/new") 200) "accessing /new")
|
||||
(is (has-status (send-request (url 2012 6 3 "some-title")) 200) "accessing test note")
|
||||
(is (has-status (send-request (url 2012 6 3 "some-title" "export")) 200) "accessing test note's export")
|
||||
(is (has-status (send-request (url 2012 6 3 "some-title" "stats")) 200) "accessing test note's stats")
|
||||
(is (has-status (send-request "/") 200) "accessing landing page"))))
|
||||
|
||||
Reference in New Issue
Block a user