fixed test added Note
This commit is contained in:
parent
9e46120bf1
commit
7a89569f66
3 changed files with 10 additions and 6 deletions
|
@ -39,6 +39,11 @@
|
||||||
|
|
||||||
(s/def ::Relationship (s/keys :req-un [::object ::und-mehr]))
|
(s/def ::Relationship (s/keys :req-un [::object ::und-mehr]))
|
||||||
|
|
||||||
|
; #### NOTE ####
|
||||||
|
; Specialities of mastodon statuses: https://docs.joinmastodon.org/spec/activitypub/#status
|
||||||
|
(s/def ::Note (s/and ::Object
|
||||||
|
(match-type "Note")))
|
||||||
|
|
||||||
; #### ACTIVITY ####
|
; #### ACTIVITY ####
|
||||||
(s/def ::Activity (s/merge
|
(s/def ::Activity (s/merge
|
||||||
::Object
|
::Object
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
actor
|
actor
|
||||||
object]))
|
object]))
|
||||||
|
|
||||||
(def like-data? (s/keys :req-un [::to ::object ::from]))
|
(def like-data? (s/keys :req-un [::object ::from]))
|
||||||
|
|
||||||
(def activity-streams-context "https://www.w3.org/ns/activitystreams")
|
(def activity-streams-context "https://www.w3.org/ns/activitystreams")
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,14 @@
|
||||||
(st/instrument `sut/generate-like-map)
|
(st/instrument `sut/generate-like-map)
|
||||||
|
|
||||||
(def test-like-data
|
(def test-like-data
|
||||||
{:to "https://chatty.bla/ben/"
|
{:object "posts/234s23-2g34234-2hhj536"
|
||||||
:target "posts/234s23-2g34234-2hhj536"
|
|
||||||
:from "https://social.bla/alyssa/"})
|
:from "https://social.bla/alyssa/"})
|
||||||
|
|
||||||
(deftest produces-valid-like
|
(deftest produces-valid-like
|
||||||
(is (= {"@context" "https://www.w3.org/ns/activitystreams",
|
(is (= {"@context" "https://www.w3.org/ns/activitystreams",
|
||||||
|
"id" "https://social.bla/alyssa/#likes/RANDOMHASH",
|
||||||
"type" "Like",
|
"type" "Like",
|
||||||
"id" "https://social.bla/alyssa/out/sdfsd44243g324g3455",
|
|
||||||
"to" "https://chatty.bla/ben/",
|
|
||||||
"actor" "https://social.bla/alyssa/",
|
"actor" "https://social.bla/alyssa/",
|
||||||
"object" "posts/234s23-2g34234-2hhj536"}
|
"object" "posts/234s23-2g34234-2hhj536"}
|
||||||
(sut/generate-like-map test-like-data))))
|
(sut/generate-like-map test-like-data))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue