Skip to content

Commit a7f9d9c

Browse files
author
kellyselden
committed
rootUrl test
1 parent 0ba40ab commit a7f9d9c

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

test/fastboot-location-test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('FastBootLocation', function () {
2626

2727
it('should NOT redirect when no transition is called', function () {
2828
return get({
29-
url: 'http://localhost:49741/test-passed',
29+
url: 'http://localhost:49741/my-root/test-passed',
3030
followRedirect: false
3131
})
3232
.then(function (response) {
@@ -35,15 +35,15 @@ describe('FastBootLocation', function () {
3535

3636
expect(response.headers).to.not.include.keys('location');
3737
expect(response.headers).to.include.keys('x-fastboot-path');
38-
expect(response.headers['x-fastboot-path']).to.equal('/test-passed');
38+
expect(response.headers['x-fastboot-path']).to.equal('/my-root/test-passed');
3939

4040
expect(response.body).to.contain('The Test Passed!');
4141
});
4242
});
4343

4444
it('should NOT redirect when intermediateTransitionTo is called', function () {
4545
return get({
46-
url: 'http://localhost:49741/redirect-on-intermediate-transition-to',
46+
url: 'http://localhost:49741/my-root/redirect-on-intermediate-transition-to',
4747
followRedirect: false
4848
})
4949
.then(function (response) {
@@ -52,7 +52,7 @@ describe('FastBootLocation', function () {
5252

5353
expect(response.headers).to.not.include.keys('location');
5454
expect(response.headers).to.include.keys('x-fastboot-path');
55-
expect(response.headers['x-fastboot-path']).to.equal('/redirect-on-intermediate-transition-to');
55+
expect(response.headers['x-fastboot-path']).to.equal('/my-root/redirect-on-intermediate-transition-to');
5656

5757
expect(response.body).to.not.contain('Welcome to Ember');
5858
expect(response.body).to.not.contain('The Test Passed!');
@@ -61,7 +61,7 @@ describe('FastBootLocation', function () {
6161

6262
it('should redirect when transitionTo is called', function () {
6363
return get({
64-
url: 'http://localhost:49741/redirect-on-transition-to',
64+
url: 'http://localhost:49741/my-root/redirect-on-transition-to',
6565
followRedirect: false
6666
})
6767
.then(function (response) {
@@ -80,7 +80,7 @@ describe('FastBootLocation', function () {
8080

8181
it('should redirect when replaceWith is called', function () {
8282
return get({
83-
url: 'http://localhost:49741/redirect-on-replace-with',
83+
url: 'http://localhost:49741/my-root/redirect-on-replace-with',
8484
followRedirect: false
8585
})
8686
.then(function (response) {

test/fixtures/fastboot-location/app/router.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import Ember from 'ember';
2+
import config from './config/environment';
23

3-
let Router = Ember.Router;
4+
const Router = Ember.Router.extend({
5+
location: config.locationType,
6+
rootURL: config.rootURL
7+
});
48

59
Router.map(function() {
610
this.route('redirect-on-intermediate-transition-to');

test/fixtures/fastboot-location/config/environment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module.exports = function(environment) {
44
var ENV = {
5-
baseUrl: '/',
5+
rootURL: '/my-root/',
66
environment: environment,
77
modulePrefix: 'fastboot-location',
88
fastboot: {

0 commit comments

Comments
 (0)