@@ -52,6 +52,7 @@ describe("Restangular", function() {
52
52
$httpBackend . whenGET ( "/accounts/post-something/foo" ) . respond ( fooModel ) ;
53
53
$httpBackend . whenPUT ( "/accounts/put-something" ) . respond ( fooModel ) ;
54
54
$httpBackend . whenGET ( "/accounts/put-something/foo" ) . respond ( fooModel ) ;
55
+ $httpBackend . whenPUT ( "/accounts/put-something/foo" ) . respond ( fooModel ) ;
55
56
$httpBackend . whenDELETE ( "/accounts/delete-something" ) . respond ( fooModel ) ;
56
57
$httpBackend . whenGET ( "/accounts/delete-something/foo" ) . respond ( fooModel ) ;
57
58
$httpBackend . whenJSONP ( "/accounts" ) . respond ( accountsModel ) ;
@@ -571,7 +572,6 @@ describe("Restangular", function() {
571
572
} ) ;
572
573
573
574
describe ( "Scoped Service" , function ( ) {
574
-
575
575
it ( "should correctly work" , function ( ) {
576
576
var Accounts = Restangular . service ( 'accounts' ) ;
577
577
Accounts . post ( newAccount ) ;
@@ -640,37 +640,39 @@ describe("Restangular", function() {
640
640
$httpBackend . flush ( ) ;
641
641
} ) ;
642
642
643
- it ( "should support post" , function ( ) {
644
- Accounts . postSomething ( { foo : 'bar' } ) . then ( function ( postSomething ) {
645
- postSomething . one ( 'foo' ) . get ( ) ;
646
- } ) ;
647
-
648
- $httpBackend . expectPOST ( '/accounts/post-something' , { foo : 'bar' } ) ;
649
- $httpBackend . expectGET ( '/accounts/post-something/foo' ) ;
650
- $httpBackend . flush ( ) ;
651
- } ) ;
652
-
653
- it ( "should support put" , function ( ) {
654
- Accounts . putSomething ( { foo : 'bar' } ) . then ( function ( putSomething ) {
655
- putSomething . one ( 'foo' ) . get ( ) ;
656
- } ) ;
643
+ it ( "should support post" , function ( ) {
644
+ Accounts . postSomething ( { foo : 'bar' } ) . then ( function ( postSomething ) {
645
+ postSomething . one ( 'foo' ) . get ( ) ;
646
+ } ) ;
647
+ $httpBackend . expectPOST ( '/accounts/post-something' , { foo : 'bar' } ) ;
648
+ $httpBackend . expectGET ( '/accounts/post-something/foo' ) ;
649
+ $httpBackend . flush ( ) ;
650
+ } ) ;
657
651
658
- $httpBackend . expectPUT ( '/accounts/put-something' , { foo : 'bar' } ) ;
659
- $httpBackend . expectGET ( '/accounts/put-something/foo' ) ;
660
- $httpBackend . flush ( ) ;
661
- } ) ;
652
+ it ( "should support put" , function ( ) {
653
+ Accounts . putSomething ( { foo : 'bar' } ) . then ( function ( putSomething ) {
654
+ putSomething . one ( 'foo' ) . get ( ) ;
655
+ var a = putSomething . one ( 'foo' ) ;
656
+ a . foo = 'bar' ;
657
+ a . put ( ) ;
658
+ } ) ;
659
+ $httpBackend . expectPUT ( '/accounts/put-something' , { foo : 'bar' } ) ;
660
+ $httpBackend . expectGET ( '/accounts/put-something/foo' ) ;
661
+ $httpBackend . expectPUT ( '/accounts/put-something/foo' , { foo : 'bar' } ) ;
662
+ $httpBackend . flush ( ) ;
663
+ } ) ;
662
664
663
- it ( "should support delete" , function ( ) {
664
- Accounts . deleteSomething ( ) . then ( function ( deleteSomething ) {
665
- deleteSomething . one ( 'foo' ) . get ( ) ;
666
- } ) ;
665
+ it ( "should support delete" , function ( ) {
666
+ Accounts . deleteSomething ( ) . then ( function ( deleteSomething ) {
667
+ deleteSomething . one ( 'foo' ) . get ( ) ;
668
+ } ) ;
667
669
668
- $httpBackend . expectDELETE ( '/accounts/delete-something' ) ;
669
- $httpBackend . expectGET ( '/accounts/delete-something/foo' ) ;
670
- $httpBackend . flush ( ) ;
671
- } ) ;
672
- } ) ;
673
- } ) ;
670
+ $httpBackend . expectDELETE ( '/accounts/delete-something' ) ;
671
+ $httpBackend . expectGET ( '/accounts/delete-something/foo' ) ;
672
+ $httpBackend . flush ( ) ;
673
+ } ) ;
674
+ } ) ;
675
+ } ) ;
674
676
675
677
describe ( "ONE" , function ( ) {
676
678
it ( "get() should return a JSON item" , function ( ) {
0 commit comments