|
|
|
@ -2,22 +2,20 @@
|
|
|
|
|
(:require
|
|
|
|
|
[clojure.test :refer [deftest is are testing run-tests]]
|
|
|
|
|
[clojure.spec.alpha :as s]
|
|
|
|
|
[clojure.string :as str]
|
|
|
|
|
[org.domaindrivenarchitecture.activity-pub-poc.core :as sut]))
|
|
|
|
|
|
|
|
|
|
(deftest should-serailize
|
|
|
|
|
(is (= "{
|
|
|
|
|
\"@context\": \"https://www.w3.org/ns/activitystreams\",
|
|
|
|
|
\"summary\": \"Sally liked a note\",
|
|
|
|
|
\"type\": \"Like\",
|
|
|
|
|
\"actor\": {
|
|
|
|
|
\"type\": \"Person\",
|
|
|
|
|
\"name\": \"Sally\"
|
|
|
|
|
},
|
|
|
|
|
\"object\": \"http://example.org/notes/1\"
|
|
|
|
|
}"
|
|
|
|
|
(sut/serialize
|
|
|
|
|
{:summary "Sally liked a note",
|
|
|
|
|
:type "Like",
|
|
|
|
|
:actor {:type "Person",
|
|
|
|
|
:name "Sally"},
|
|
|
|
|
:object "http://example.org/notes/1"}))))
|
|
|
|
|
(is (= (str "{\"@context\": \"https://www.w3.org/ns/activitystreams\", "
|
|
|
|
|
"\"summary\": \"Sally liked a note\", "
|
|
|
|
|
"\"type\": \"Like\", "
|
|
|
|
|
"\"actor\": {"
|
|
|
|
|
"\"type\": \"Person\", "
|
|
|
|
|
"\"name\": \"Sally\"}, "
|
|
|
|
|
"\"object\": \"http://example.org/notes/1\"}")
|
|
|
|
|
(sut/serialize
|
|
|
|
|
{:summary "Sally liked a note",
|
|
|
|
|
:type "Like",
|
|
|
|
|
:actor {:type "Person",
|
|
|
|
|
:name "Sally"},
|
|
|
|
|
:object "http://example.org/notes/1"}))))
|