public/javascripts/specs/lib/model_spec.js in riojs-0.0.0 vs public/javascripts/specs/lib/model_spec.js in riojs-0.0.1
- old
+ new
@@ -1613,9 +1613,19 @@
entity.getId().shouldEqual(28);
entity.getProjectId().shouldEqual(15);
}.shouldBeCalled()
});
},
+
+ "by calling the onFailure function if the entity is not found": function() {
+ stub(Ajax, "Request").andDo(function(url, options) {
+ options.onFailure();
+ }.shouldBeCalled());
+
+ this.model.find(28, {
+ onFailure: function() {}.shouldBeCalled()
+ });
+ },
"by getting the entity synchronously and returning it if no onSuccess method is provided": function() {
var buildResponse = function(json) {
return rio.environment.includeRootInJson ? { resource: json } : json;
};
\ No newline at end of file