Permalink
Browse files

- casting isError() return value to be YES or NO

  • Loading branch information...
1 parent da315bf commit 653d447c2cb30d5820b77f7bc6d9b1ff393a7ca9 @bascht bascht committed Jul 15, 2011
@@ -729,7 +729,7 @@ SC.Record = SC.Object.extend(
@dependsOn status
*/
isError: function() {
- return this.get('status') & SC.Record.ERROR;
+ return !!(this.get('status') & SC.Record.ERROR);
}.property('status').cacheable(),
/**
@@ -45,8 +45,8 @@ test("Verify error methods behave correctly", function() {
store.dataSourceDidError(storeKey, SC.Record.GENERIC_ERROR);
SC.RunLoop.end();
- ok(thing1.get('isError'), "isError on thing1 should be YES");
- ok(!thing2.get('isError'), "isError on thing2 should be NO");
+ ok((thing1.get('isError') === YES), "isError on thing1 should be YES");
+ ok((thing2.get('isError') === NO), "isError on thing2 should be NO");
equals(thing1.get('errorObject'), SC.Record.GENERIC_ERROR,
"get('errorObject') on thing1 should return the correct error object");

0 comments on commit 653d447

Please sign in to comment.