-
-
Save martinklepsch/6cdb6ee4c5516b6186ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftest notification-unsuccessful | |
(testing "Notification url returns error" | |
(let [requests (atom 0)] | |
(with-fake-http [test-uri (fn [orig-fn opts callback] | |
(swap! requests inc) | |
{:status 500 :body "ok"})] | |
(n/notify test-uri #(= % "ok") :wait-times [1 2 3 4]) | |
(Thread/sleep 100) | |
(is (= 5 @requests))))) | |
(testing "Notification check-fn not fulfilled" | |
(let [requests (atom 0)] | |
(with-fake-http [test-uri (fn [orig-fn opts callback] | |
(swap! requests inc) | |
{:status 200 :body "unexpected"})] | |
(n/notify test-uri #(= % "ok") :wait-times [1 2 3 4]) | |
(Thread/sleep 100) | |
(is (= 5 @requests)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment