 		it "should be able to save the transaction in the db", (done) ->
 			messageStore.storeTransaction ctx, (error, result) ->
 				should.not.exist(error)
-				transactions.Transaction.findOne { '_id': result._id }, (error, trans) ->
+				Transaction.findOne { '_id': result._id }, (error, trans) ->
 					should.not.exist(error)
 					(trans != null).should.be.true
 					trans.clientID.should.equal "Master_OpenMRS_Instance"

				ctx.transactionId = storedTrans._id
				messageStore.storeResponse ctx, (err2) ->
					should.not.exist(err2)
					transactions.Transaction.findOne { '_id': storedTrans._id }, (err3, trans) ->
						should.not.exist(err3)
						(trans != null).should.true
						trans.response.status.should.equal 201

sinon = require "sinon"
http = require "http"
messageStore = require "../../lib/middleware/messageStore"
Transaction = require("../../lib/model/transactions").Transaction

transactionId = null

beforeEach (done) ->
	Transaction.remove {}, ->
		done();

afterEach (done)->
	Transaction.remove {}, ->
		done();

describe "MessageStore", ->
	req = new Object()
