@@ -136,11 +136,11 @@ describe('$firebase', function () {
136136 it ( 'should reject if fails' , function ( ) {
137137 var whiteSpy = jasmine . createSpy ( 'resolve' ) ;
138138 var blackSpy = jasmine . createSpy ( 'reject' ) ;
139- $fb . $ref ( ) . failNext ( 'push' , 'failpush' ) ;
139+ $fb . $ref ( ) . failNext ( 'push' , new Error ( 'failpush' ) ) ;
140140 $fb . $push ( { foo : 'bar' } ) . then ( whiteSpy , blackSpy ) ;
141141 flushAll ( ) ;
142142 expect ( whiteSpy ) . not . toHaveBeenCalled ( ) ;
143- expect ( blackSpy ) . toHaveBeenCalledWith ( 'failpush' ) ;
143+ expect ( blackSpy ) . toHaveBeenCalledWith ( new Error ( 'failpush' ) ) ;
144144 } ) ;
145145
146146 it ( 'should save correct data into Firebase' , function ( ) {
@@ -206,13 +206,13 @@ describe('$firebase', function () {
206206 } ) ;
207207
208208 it ( 'should reject if fails' , function ( ) {
209- $fb . $ref ( ) . failNext ( 'set' , 'setfail' ) ;
209+ $fb . $ref ( ) . failNext ( 'set' , new Error ( 'setfail' ) ) ;
210210 var whiteSpy = jasmine . createSpy ( 'resolve' ) ;
211211 var blackSpy = jasmine . createSpy ( 'reject' ) ;
212212 $fb . $set ( { foo : 'bar' } ) . then ( whiteSpy , blackSpy ) ;
213213 flushAll ( ) ;
214214 expect ( whiteSpy ) . not . toHaveBeenCalled ( ) ;
215- expect ( blackSpy ) . toHaveBeenCalledWith ( 'setfail' ) ;
215+ expect ( blackSpy ) . toHaveBeenCalledWith ( new Error ( 'setfail' ) ) ;
216216 } ) ;
217217
218218 it ( 'should affect query keys only if query used' , function ( ) {
@@ -285,11 +285,11 @@ describe('$firebase', function () {
285285 it ( 'should reject if fails' , function ( ) {
286286 var whiteSpy = jasmine . createSpy ( 'resolve' ) ;
287287 var blackSpy = jasmine . createSpy ( 'reject' ) ;
288- $fb . $ref ( ) . failNext ( 'remove' , 'test_fail_remove' ) ;
288+ $fb . $ref ( ) . failNext ( 'remove' , new Error ( 'test_fail_remove' ) ) ;
289289 $fb . $remove ( ) . then ( whiteSpy , blackSpy ) ;
290290 flushAll ( ) ;
291291 expect ( whiteSpy ) . not . toHaveBeenCalled ( ) ;
292- expect ( blackSpy ) . toHaveBeenCalledWith ( 'test_fail_remove' ) ;
292+ expect ( blackSpy ) . toHaveBeenCalledWith ( new Error ( 'test_fail_remove' ) ) ;
293293 } ) ;
294294
295295 it ( 'should remove data in Firebase' , function ( ) {
@@ -371,11 +371,11 @@ describe('$firebase', function () {
371371 it ( 'should reject if failed' , function ( ) {
372372 var whiteSpy = jasmine . createSpy ( 'resolve' ) ;
373373 var blackSpy = jasmine . createSpy ( 'reject' ) ;
374- $fb . $ref ( ) . failNext ( 'update' , 'oops' ) ;
374+ $fb . $ref ( ) . failNext ( 'update' , new Error ( 'oops' ) ) ;
375375 $fb . $update ( { index : { foo : 'bar' } } ) . then ( whiteSpy , blackSpy ) ;
376376 flushAll ( ) ;
377377 expect ( whiteSpy ) . not . toHaveBeenCalled ( ) ;
378- expect ( blackSpy ) . toHaveBeenCalled ( ) ;
378+ expect ( blackSpy ) . toHaveBeenCalledWith ( new Error ( 'oops' ) ) ;
379379 } ) ;
380380
381381 it ( 'should not destroy untouched keys' , function ( ) {
@@ -435,11 +435,11 @@ describe('$firebase', function () {
435435 it ( 'should reject if failed' , function ( ) {
436436 var whiteSpy = jasmine . createSpy ( 'success' ) ;
437437 var blackSpy = jasmine . createSpy ( 'failed' ) ;
438- $fb . $ref ( ) . child ( 'a' ) . failNext ( 'transaction' , 'test_fail' ) ;
438+ $fb . $ref ( ) . child ( 'a' ) . failNext ( 'transaction' , new Error ( 'test_fail' ) ) ;
439439 $fb . $transaction ( 'a' , function ( ) { return true ; } ) . then ( whiteSpy , blackSpy ) ;
440440 flushAll ( ) ;
441441 expect ( whiteSpy ) . not . toHaveBeenCalled ( ) ;
442- expect ( blackSpy ) . toHaveBeenCalledWith ( 'test_fail' ) ;
442+ expect ( blackSpy ) . toHaveBeenCalledWith ( new Error ( 'test_fail' ) ) ;
443443 } ) ;
444444
445445 it ( 'should modify data in firebase' , function ( ) {
0 commit comments