component extends="coldbox.system.testing.BaseModelTest" model="models.quote.Quote" {
variables.validData = {
// ... test data
};
/*********************************** LIFE CYCLE Methods ***********************************/
function beforeAll(){
super.beforeAll();
// setup the model
super.setup();
// init the model object
model.init();
}
function afterAll(){
super.afterAll();
}
/*********************************** BDD SUITES ***********************************/
function run(){
describe( "A Quote", function(){
it( "can be created", function(){
expect( model ).toBeComponent();
});
it( "will validate when given proper data", function() {
var validationManager = application.wirebox.getInstance( "ValidationManager@cbvalidation" );
var quote = application.wirebox
.getObjectPopulator()
.populateFromStruct(
target = model,
memento = validData
)
;
var validationResult = validationManager.validate( quote );
debug( validationResult );
} );
});
}
}