Skip to content

Commit

Permalink
fix test descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
dpetran committed Dec 20, 2023
1 parent 3967854 commit a371f92
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions test/fluree/server/integration/policy_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
:headers json-headers}
txn-res (api-post :transact txn-req)]
(is (not= 200 (:status txn-res))
(str "transaction policy opts should have prevented modification, instead response was: " (pr-str txn-res)))
"transaction policy opts prevented modification")
(let [query-req {:body
(json/write-value-as-string
{"@context" test-system/default-context
Expand All @@ -119,11 +119,10 @@
"did" alice-did}})
:headers json-headers}
query-res (api-post :history query-req)]
(is (= 200 (:status query-res))
(str "History query response was: " (pr-str query-res)))
(is (= 200 (:status query-res)))
(is (= [{"id" "ex:bob", "type" "ex:User"}]
(-> query-res :body json/read-value first (get "f:assert")))
"policy opts should have prevented seeing bob's secret"))))
"policy opts prevented seeing bob's secret"))))
(testing "credential requests"
(let [txn-req (<!! (cred/generate
{"@context" ["https://ns.flur.ee" test-system/default-context]
Expand All @@ -134,7 +133,7 @@
txn-res (api-post :transact {:body (json/write-value-as-string txn-req)
:headers json-headers})]
(is (not= 200 (:status txn-res))
(str "transaction policy opts should have prevented modification, instead response was: " (pr-str txn-res)))
"transaction policy opts prevented modification")
(let [query-req (<!! (cred/generate
{"@context" test-system/default-context
"from" ledger-name
Expand All @@ -143,11 +142,10 @@
(:private auth)))
query-res (api-post :history {:body (json/write-value-as-string query-req)
:headers json-headers})]
(is (= 200 (:status query-res))
(str "History query response was: " (pr-str query-res)))
(is (= 200 (:status query-res)))
(is (= [{"id" "ex:bob", "type" "ex:User"}]
(-> query-res :body json/read-value first (get "f:assert")))
"policy opts should have prevented seeing bob's secret"))))
"policy opts prevented seeing bob's secret"))))
(testing "JWS requests"
(let [txn-req {"@context" ["https://ns.flur.ee" test-system/default-context]
"ledger" ledger-name
Expand All @@ -158,7 +156,7 @@
(:private auth))
:headers json-headers})]
(is (not= 200 (:status txn-res))
(str "transaction policy opts should have prevented modification, instead response was: " (pr-str txn-res)))
"transaction policy opts prevented modification")
(let [query-req {"@context" test-system/default-context
"from" ledger-name
"history" "ex:bob"
Expand All @@ -168,11 +166,10 @@
(json/write-value-as-string query-req)
(:private auth)))
:headers json-headers})]
(is (= 200 (:status query-res))
(str "History query response was: " (pr-str query-res)))
(is (= 200 (:status query-res)))
(is (= [{"id" "ex:bob", "type" "ex:User"}]
(-> query-res :body json/read-value first (get "f:assert")))
"policy opts should have prevented seeing bob's secret"))))))))
"policy opts prevented seeing bob's secret"))))))))

#_(deftest ^:integration ^:edn policy-opts-edn-test
(testing "policy-enforcing opts are correctly handled"
Expand Down

0 comments on commit a371f92

Please sign in to comment.