@@ -40,21 +40,12 @@ describe('EntryService', () => {
4040 } ) ;
4141
4242 it ( 'loads an activeEntry with /running' , ( ) => {
43- service . urlInProduction = true ;
4443 service . loadActiveEntry ( ) . subscribe ( ) ;
4544
4645 const loadEntryRequest = httpMock . expectOne ( `${ service . baseUrl } /running` ) ;
4746 expect ( loadEntryRequest . request . method ) . toBe ( 'GET' ) ;
4847 } ) ;
4948
50- it ( 'loads an activeEntry with /active/{userId}' , ( ) => {
51- service . urlInProduction = false ;
52- service . loadActiveEntry ( ) . subscribe ( ) ;
53-
54- const loadEntryRequest = httpMock . expectOne ( `${ service . baseUrl } /active/2` ) ;
55- expect ( loadEntryRequest . request . method ) . toBe ( 'GET' ) ;
56- } ) ;
57-
5849 it ( 'loads summary with get /summary?time_offset=<time-offset>' , ( ) => {
5950 service . summary ( ) . subscribe ( ) ;
6051 const timeOffset = new Date ( ) . getTimezoneOffset ( ) ;
@@ -93,12 +84,21 @@ describe('EntryService', () => {
9384 } ) ;
9485
9586 it ( 'stops an entry using POST' , ( ) => {
87+ service . urlInProduction = true ;
9688 service . stopEntryRunning ( 'id' ) . subscribe ( ) ;
9789
9890 const updateEntryRequest = httpMock . expectOne ( `${ service . baseUrl } /id/stop` ) ;
9991 expect ( updateEntryRequest . request . method ) . toBe ( 'POST' ) ;
10092 } ) ;
10193
94+ it ( 'stops an entry using PUT' , ( ) => {
95+ service . urlInProduction = false ;
96+ service . stopEntryRunning ( 'id' ) . subscribe ( ) ;
97+
98+ const updateEntryRequest = httpMock . expectOne ( `${ service . baseUrl } /stop` ) ;
99+ expect ( updateEntryRequest . request . method ) . toBe ( 'PUT' ) ;
100+ } ) ;
101+
102102 it ( 'when getting time entries for report, time range should be sent' , ( ) => {
103103 const yesterday = moment ( new Date ( ) ) . subtract ( 1 , 'day' ) ;
104104 const today = moment ( new Date ( ) ) ;
0 commit comments