Skip to content
Snippets Groups Projects
Commit 7dfc7956 authored by Cam Saul's avatar Cam Saul
Browse files

Unit test for PUT /api/card/:id, fix new-sql-timestamp

parent 5d6b9e5d
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,10 @@
(Some DBs like Postgres will get snippy if you don't use a `java.sql.Timestamp`)."
[]
(-> (java.util.Date.)
.getTime
.getTime ; time in milliseconds
(/ 1000) ; we don't care about the ms so strip them out
int
(* 1000)
(java.sql.Timestamp.)))
(defn parse-iso8601
......
......@@ -84,6 +84,18 @@
(-> ((user->client :rasta) :get 200 (format "card/%d" id))
(deserialize-dates :updated_at :created_at)))))
;; ## PUT /api/card/:id
;; Test that we can edit a Card
(let [card-name (random-name)
updated-name (random-name)]
(expect-eval-actual-first
[card-name
updated-name]
(let [{id :id} (post-card card-name)]
[(sel :one :field [Card :name] :id id)
(do ((user->client :rasta) :put 200 (format "card/%d" id) {:name updated-name})
(sel :one :field [Card :name] :id id))])))
;; ## DELETE /api/card/:id
;; Check that we can delete a card
(expect-eval-actual-first nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment