last bugs fixed

This commit is contained in:
Christian Mueller
2014-01-17 22:27:08 +01:00
parent 9bd70deadc
commit c84909d891
4 changed files with 39 additions and 6 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
(def pid "somePlugin")
(def pid2 "somePlugin2")
(def note-title (str (apply print-str (get-date)) " hello-world-this-is-a-test-note"))
(def note-url (str "/" (apply str (interpose "/" (get-date))) "/hello-world-this-is-a-test-note"))
(def note-url (str (apply str (interpose "/" (get-date))) "/hello-world-this-is-a-test-note"))
(defn substring? [a b] (not (= nil (re-matches (re-pattern (str "(?s).*" a ".*")) b))))
(defmacro isnt [arg] `(is (not ~arg)))
+19
View File
@@ -48,6 +48,25 @@
(delete-note (build-key date title))
(not (note-exists? (build-key date title))))))))
(deftest note-creation-utf
(let [session-key (create-session)
date (get-date)
title "радуга"
note "# Радуга\nкаждый охотник желает знать, где сидят фазаны."
[year month day] date]
(testing "Note creation with UTF8 symbols"
(is (has-status
(send-request
[:post "/post-note"]
{:session session-key
:note note
:signature (get-signature session-key note)}) 302))
(is (note-exists? (build-key date title)))
(is (substring? "знать" ((send-request (url year month day title)) :body)))
(is (do
(delete-note (build-key date title))
(not (note-exists? (build-key date title))))))))
(deftest note-update
(let [session-key (create-session)
date (get-date)