   (testing "Test init function setting parameters and retrieving code and tokens."
     (reset! app-state middle-state-map)
     (reset-channels)
-    (a/go (a/>!! code-chan (:code final-state-map)))
+    (a/go (a/>! code-chan (:code final-state-map)))
     (with-redefs [clj-http.client/get (constantly (:token-response final-state-map)) clj-http.client/post  (constantly (:token-response final-state-map))]
       (is (= final-state-map (update-in (init) [:token-response :request-time] (fn [x] 0)))))))
 

  (deftest test-request-access-to-data
    (testing "Build auth url and fetch code."
    (reset-channels)
    (a/go (a/>!! code-chan (:code final-state-map)))
        (with-redefs [clj-http.client/get (constantly (:token-response final-state-map))]
       (is (= final-state-map) (update-in  (request-access-to-data (dissoc final-state-map :code)) [:token-response :request-time] (fn [x] 0)))))) 


(deftest test-fetch-code
  (testing "Test issuing http get for auth-code from oauth provider."
   (reset-channels)
   (a/go (a/>! code-chan (:code final-state-map)))
   (with-redefs [clj-http.client/get (constantly (:token-response final-state-map))]
      (is (= final-state-map (fetch-code final-state-map))))))

