Permalink
Browse files

Add a small test for `clear`

  • Loading branch information...
1 parent f0d1e6c commit 891e4e80fb595a27faf864a81344ce200cfcec8c @PaulUithol committed Jan 21, 2014
Showing with 16 additions and 0 deletions.
  1. +16 −0 test/tests.js
View
16 test/tests.js
@@ -844,6 +844,22 @@ $(document).ready(function() {
var result = person.set( { 'name': 'Hector' } );
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() {
var relations = person1.getRelations();

0 comments on commit 891e4e8

Please sign in to comment.