'use strict';

require('../test_helper');

var Factory = require('factory-lady'),
    mongoose = require('mongoose');

mongoose.model('ConfigVersion', new mongoose.Schema({
  version: {
    type: Date,
    unique: true,
  },
  config: mongoose.Schema.Types.Mixed,
}, { collection: 'config_versions' }));

Factory.define('config_version', mongoose.testConnection.model('ConfigVersion'), {
  version: function(callback) {
    callback(new Date());
  },
});

'use strict';

require('../test_helper');

var Factory = require('factory-lady'),
    mongoose = require('mongoose');

mongoose.model('RouterConfigVersion', new mongoose.Schema({
  version: {
    type: Date,
    unique: true,
  },
  config: mongoose.Schema.Types.Mixed,
}, { collection: 'config_versions' }));

Factory.define('config_version', mongoose.testConnection.model('RouterConfigVersion'), {
  version: function(callback) {
    callback(new Date());
  },
});

Fix conflicting model in tests with the api-umbrella-config module.
Fix conflicting model in tests with the api-umbrella-config module.

I'm not sure why this didn't happen before, but I think it might be
related to getting the api-umbrella-config module bumped and on the same
version of mongoose as the router and gatekeeper.

This could be handled better, but in the meantime, we'll just call the
router one something different.
