A JugglingDB adapter for factory-girl
- Load
factory-girl
and set the adaptervar factory = require("factory-girl"); var JugglingDbAdapter = require("../").JugglingDbAdapter; factory.setAdapter(JugglingDbAdapter);
- Load your JugglingDB model
var User = require("./resources/User").User;
- Define your factories
factory.define("user", User, { name:"Rudy" });
- Use your factories
factory.create("user", function(err, user){ // user is a `User' object });
- Destroy all factories
factory.cleanup(function(){ // ... });