Compare commits
No commits in common. "0e00da5c9a6896fa74a591618edf51b34a1df944" and "3dd9ff8ed00e41f48412fac5fee88f38281cd8b5" have entirely different histories.
0e00da5c9a
...
3dd9ff8ed0
10 changed files with 29 additions and 28 deletions
|
@ -1,5 +0,0 @@
|
||||||
(ns org.domaindrivenarchitecture.activity-pub-poc.core
|
|
||||||
(:require [clojure.spec.alpha :as s]
|
|
||||||
[orchestra.core :refer [defn-spec]]
|
|
||||||
[org.domaindrivenarchitecture.activity-pub-poc.spec-helper :as sh]
|
|
||||||
[org.domaindrivenarchitecture.activity-pub-poc.activitystreams2 :as as]))
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
(ns org.domaindrivenarchitecture.activity-pub-poc.activitystreams2-legacy-test
|
||||||
|
(:require
|
||||||
|
[clojure.test :refer [deftest is are testing run-tests]]
|
||||||
|
[clojure.spec.test.alpha :as st]
|
||||||
|
[clojure.spec.alpha :as s]
|
||||||
|
[org.domaindrivenarchitecture.activity-pub-poc.activitystreams2-legacy :as sut]))
|
||||||
|
|
||||||
|
;(deftest id-test
|
||||||
|
; (is (s/valid? ::sut/id "https://social.bla/alyssa/status/RANDOMHASH")))
|
||||||
|
|
||||||
|
;(deftest type-test
|
||||||
|
; (is (s/valid? ::sut/type "Note"))
|
||||||
|
; (is (s/valid? ::sut/type "Link"))
|
||||||
|
; (is (not(s/valid? ::sut/type "non existing"))))
|
||||||
|
|
||||||
|
;(deftest object-test
|
||||||
|
; (is (s/valid? ::sut/Object "https://social.bla/alyssa/status/RANDOMHASH")
|
||||||
|
; (is (s/valid? ::sut/Object {:id "https://social.bla/alyssa/status/RANDOMHASH" :type "Page"}))))
|
||||||
|
;
|
||||||
|
;(deftest link-test
|
||||||
|
; (is (s/valid? ::sut/Link {:type "Link"})))
|
||||||
|
|
||||||
|
;(deftest Note-test
|
||||||
|
; (is (s/valid?
|
||||||
|
; ::sut/Note
|
||||||
|
; {:id "https://social.bla/alyssa/status/RANDOMHASH"
|
||||||
|
; :type "Note"
|
||||||
|
; :content "text"})))
|
|
@ -1,6 +1,7 @@
|
||||||
(ns org.domaindrivenarchitecture.activity-pub-poc.activitystreams2-test
|
(ns org.domaindrivenarchitecture.activity-pub-poc.activitystreams2-test
|
||||||
(:require
|
(:require
|
||||||
[clojure.test :refer [deftest is are testing run-tests]]
|
[clojure.test :refer [deftest is are testing run-tests]]
|
||||||
|
[clojure.spec.test.alpha :as st]
|
||||||
[clojure.spec.alpha :as s]
|
[clojure.spec.alpha :as s]
|
||||||
[org.domaindrivenarchitecture.activity-pub-poc.activitystreams2 :as sut]))
|
[org.domaindrivenarchitecture.activity-pub-poc.activitystreams2 :as sut]))
|
||||||
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
(ns org.domaindrivenarchitecture.activity-pub-poc.core-test
|
|
||||||
(:require
|
|
||||||
[clojure.test :refer [deftest is are testing run-tests]]
|
|
||||||
[clojure.spec.alpha :as s]
|
|
||||||
[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"}))))
|
|
Loading…
Reference in a new issue