on the way

This commit is contained in:
didier amyot committed 2018-10-14 20:04:18 -04:00
1 parent 82b43ddf90
commit 6e266c787b
14 files changed
+146 -45

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
(ns skirmish.broker.broker-test
(:require [midje.sweet :refer :all]
[orchestra.spec.test :as st]
[skirmish.broker.broker :refer [add-account-urls]]))
(st/instrument)
(facts "the broker util functions"
(fact "it should be able to add url to accounts"
(let [user {:skirmish.broker.user/accounts [{:skirmish.broker.account/id "foo"}]}
ret {:skirmish.broker.user/accounts [{:skirmish.broker.account/id "foo"
:skirmish.broker.account/url "http://localhost:1604/api/1/ledger/accounts/foo"}]}]
(add-account-urls user) => ret)))
+2 -2
View File
@@ -1,5 +1,5 @@
(ns skirmish.exchange.exchange-test
(:import [skirmish.PersistentSortedList])
(:import (skirmish PersistentSortedList))
(:require [midje.sweet :refer :all]
[orchestra.spec.test :as st]
[skirmish.exchange.exchange :refer :all]
@@ -9,7 +9,7 @@
(st/instrument)
(def PersistentSortedList? (comp #(= % skirmish.PersistentSortedList) type))
(def PersistentSortedList? (comp #(= % PersistentSortedList) type))
(facts "the exchange as an whole"
(fact "process-sell-order should work when book empty"
+1 -3
View File
@@ -41,8 +41,6 @@
(def mock-currencies [[:zimbabwean-dollar 1000000 :currency "zimbabwean dollar" "rot13" "zd"]])
(defn create-some-securities [conn]
(let [cs (create-security conn)
create-security-1 {:body (edn->stream (get mock-securities 0)) :headers {"accept" "application/edn"}}
@@ -101,7 +99,7 @@
request {:route-params {:sec-id :new-currency} :headers {"accept" "application/edn"}}
resp ((get-security conn) request)]
resp => (spec-check ::ok)
(body resp) => {:sec-id :new-currency :interest-rate 100}))
(body resp) => {:sec-id :new-currency :interest-rate 100 :description nil :type nil :volume nil}))
(fact "we should not be able to get-security if it does not exists"
(let [conn (create-conn)