diff --git a/Resources/coffee/ng-router.coffee b/Resources/coffee/ng-router.coffee index e148729..a3e734d 100644 --- a/Resources/coffee/ng-router.coffee +++ b/Resources/coffee/ng-router.coffee @@ -65,7 +65,7 @@ class cypress.NgRouter host = @findRoute(routeName)?.getHost() return "#{cypress.NgRouter.scheme}://#{host}#{cypress.NgRouter.baseUrl}#{path}" else - return path + return "#{cypress.NgRouter.baseUrl}#{path}" findRoute: (routeName) -> matchedRoute = null diff --git a/Resources/public/ng-router.js b/Resources/public/ng-router.js index b5b7253..3f0e2ca 100644 --- a/Resources/public/ng-router.js +++ b/Resources/public/ng-router.js @@ -103,7 +103,7 @@ host = (_ref1 = this.findRoute(routeName)) != null ? _ref1.getHost() : void 0; return "" + cypress.NgRouter.scheme + "://" + host + cypress.NgRouter.baseUrl + path; } else { - return path; + return "" + cypress.NgRouter.baseUrl + path; } }; diff --git a/Resources/test/spec/ng-router.coffee b/Resources/test/spec/ng-router.coffee index b8e5883..7c1dbd2 100644 --- a/Resources/test/spec/ng-router.coffee +++ b/Resources/test/spec/ng-router.coffee @@ -110,7 +110,7 @@ describe 'cypress.NgRouter', -> expect(ngRouter.generateResourceUrl('test')).toBe('scheme://host/base_url/test/:id') it 'should generate a route by its name, without the absolute path', -> - expect(ngRouter.generateResourceUrl('test', false)).toBe('/test/:id') + expect(ngRouter.generateResourceUrl('test', false)).toBe('/base_url/test/:id') it 'should have a generateResourceUrl method', -> expect(ngRouter.generateResourceUrl).toBeDefined()