/factory-girl-jugglingdb

A JugglingDB adapter for factory-girl package

Primary LanguageJavaScript

factory-girl-jugglingdb

A JugglingDB adapter for factory-girl

Usage

  • Load factory-girl and set the adapter
    var 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(){
        // ...
    });