Permalink
Browse files

Add some tests.

  • Loading branch information...
1 parent 9192dd2 commit 3c0f89193165ca41828330765ab18d33e155cc8a @Raynes Raynes committed Mar 29, 2012
Showing with 16 additions and 7 deletions.
  1. +0 −7 test/clj_geni/core_test.clj
  2. +16 −0 test/geni/core_test.clj
@@ -1,7 +0,0 @@
-(ns clj-geni.core-test
- (:use clojure.test
- clj-geni.core))
-
-(deftest a-test
- (testing "FIXME, I fail."
- (is (= 0 1))))
View
@@ -0,0 +1,16 @@
+(ns geni.core-test
+ (:use clojure.test)
+ (:require [geni.core :as geni]
+ [clojure.string :as string]))
+
+(def token (string/trim-newline (slurp "token")))
+
+(deftest read-test
+ (is (= {:name "Amos Elliston", :id "profile-101"}
+ (geni/read "/profile-101" {:token token, :fields ["name" "id"]}))))
+
+(deftest write-test
+ (let [document (geni/write "/document/add" {:token token, :title "foo", :text "foo"})]
+ (is (= "foo" (:title document)))
+ (is (= {:result "Deleted"}
+ (geni/write (str "/" (:id document) "/delete") {:token token})))))

0 comments on commit 3c0f891

Please sign in to comment.