File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ export default class Model extends StaticModel {
255
255
256
256
get ( ) {
257
257
let base = this . _fromResource || `${ this . baseURL ( ) } /${ this . resource ( ) } `
258
- base = this . _customResource || base
258
+ base = this . _customResource ? ` ${ this . baseURL ( ) } / ${ this . _customResource } ` : base
259
259
let url = `${ base } ${ this . _builder . query ( ) } `
260
260
261
261
return this . request ( {
Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ describe('Model methods', () => {
303
303
test ( 'a request with custom() method hits the right resource' , async ( ) => {
304
304
305
305
axiosMock . onAny ( ) . reply ( ( config ) => {
306
- expect ( config . url ) . toBe ( ' postz' )
306
+ expect ( config . url ) . toEqual ( `http://localhost/ postz` )
307
307
308
308
return [ 200 , { } ]
309
309
} )
@@ -314,7 +314,7 @@ describe('Model methods', () => {
314
314
test ( 'custom() gracefully handles accidental / for string arguments' , async ( ) => {
315
315
316
316
axiosMock . onAny ( ) . reply ( ( config ) => {
317
- expect ( config . url ) . toBe ( 'postz/recent' )
317
+ expect ( config . url ) . toBe ( 'http://localhost/ postz/recent' )
318
318
319
319
return [ 200 , { } ]
320
320
} )
@@ -328,7 +328,7 @@ describe('Model methods', () => {
328
328
329
329
axiosMock . onAny ( ) . reply ( ( config ) => {
330
330
expect ( config . method ) . toEqual ( 'get' )
331
- expect ( config . url ) . toEqual ( 'users/1/postz/comments' )
331
+ expect ( config . url ) . toEqual ( 'http://localhost/ users/1/postz/comments' )
332
332
333
333
return [ 200 , { } ]
334
334
} )
You can’t perform that action at this time.
0 commit comments