Skip to content

Commit

Permalink
Add a small test for clear
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulUithol committed Jan 21, 2014
1 parent f0d1e6c commit 891e4e8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/tests.js
Expand Up @@ -844,6 +844,22 @@ $(document).ready(function() {
var result = person.set( { 'name': 'Hector' } ); var result = person.set( { 'name': 'Hector' } );
ok( result === person, "Set returns the model" ); ok( result === person, "Set returns the model" );
}); });

test( "clear", function() {
var person = new Person( { id: 'person-10' } );

ok( person === Person.findOrCreate( 'person-10' ) );

person.clear();

ok( !person.id );

ok( !Person.findOrCreate( 'person-10' ) );

person.set( { id: 'person-10' } );

ok( person === Person.findOrCreate( 'person-10' ) );
});


test( "getRelations", function() { test( "getRelations", function() {
var relations = person1.getRelations(); var relations = person1.getRelations();
Expand Down

0 comments on commit 891e4e8

Please sign in to comment.