title: How To Unit Test MongoDB with Luminus?
body: <p>I'm probably missing something simple, but I'm not experienced enough with clojure to understand the error I'm getting. </p>
  
  <p>I have a simple luminus clojure app setup with the Monger library to handle my MongoDB connection. I've added a simple test that should always pass to my tests file. </p>
  
  <pre><code>(testing "create user"
      (let [result (db/create-user "test" "test" "test")]
      (is (true? true))))
  </code></pre>
  
  <p>This doesn't work however, and throws the following error</p>
  
  <pre><code>java.lang.ClassCastException: mount.core.DerefableState cannot be cast to com.mongodb.DB
  </code></pre>
  
  <p>I'm assuming this has to do with the test environment not properly setting up the database stuff and failing there. I've done a bit of searching, but nothing helpful has come up and there doesn't appear to be any testing help in the Monger Docs. I know for sure that the above <code>create-user</code> call does work when running in the actual environment. </p>