about summary refs log tree commit diff
path: root/web/panettone/test/model_test.lisp
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2020-07-28T04·31-0400
committerglittershark <grfn@gws.fyi>2020-07-31T02·05+0000
commit8e7ba41a3486a53de139486b75d72a349d13c415 (patch)
treec4f4cf72e6d34075448071ec31033d34b8cafd3c /web/panettone/test/model_test.lisp
parent14a8142f7611378195234895aaa172983b6d5a10 (diff)
feat(web/panettone): Log when users change issue statuses r/1509
Log in the database, in a way that will generalize to tracking edit
history as well, when users change the status of an issue. To facilitate
easily knowing who is currently authenticated (without introducing a
circular dependency) the authentication-relaated code has also been
factored out into its own package, which is nice because we want to
replace that sooner rather than later anyway.

Fixes: #13
Change-Id: I65a544fab660ed1c295ee8f6b293e0d4945a8203
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1496
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'web/panettone/test/model_test.lisp')
-rw-r--r--web/panettone/test/model_test.lisp13
1 files changed, 13 insertions, 0 deletions
diff --git a/web/panettone/test/model_test.lisp b/web/panettone/test/model_test.lisp
new file mode 100644
index 000000000000..e4cd78a65a43
--- /dev/null
+++ b/web/panettone/test/model_test.lisp
@@ -0,0 +1,13 @@
+(in-package :panettone.tests)
+(declaim (optimize (safety 3)))
+
+(test initialize-issue-status-test
+  (let ((issue (make-instance 'model:issue :status "open")))
+    (is (eq :open (model:status issue)))))
+
+(test initialize-issue-created-at-test
+  (let* ((time (get-universal-time))
+         (issue (make-instance 'model:issue :created-at time)))
+    (is (local-time:timestamp=
+         (local-time:universal-to-timestamp time)
+         (model:created-at issue)))))