Skip to content

Commit 377748d

Browse files
committed
Merge pull request #201 from arjansingh/error
Do not compute FastBootService.request in the browser
2 parents 121aa03 + 60690b4 commit 377748d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

app/services/fastboot.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export default Ember.Service.extend({
8484
response: readOnly('_fastbootInfo.response'),
8585

8686
request: computed(function() {
87+
if (!get(this, 'isFastBoot')) return null;
8788
return RequestObject.create({ request: get(this, '_fastbootInfo.request') });
8889
}),
8990

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { moduleFor, test } from 'ember-qunit';
2+
3+
moduleFor('service:fastboot', 'Unit | Service | fastboot in the browser', {});
4+
5+
test('isFastBoot', function(assert) {
6+
let service = this.subject();
7+
assert.equal(service.get('isFastBoot'), false, `it should be false`);
8+
});
9+
10+
test('request', function(assert) {
11+
let service = this.subject();
12+
assert.equal(service.get('request'), null, `it should be null`);
13+
});
14+
15+
test('response', function(assert) {
16+
let service = this.subject();
17+
assert.equal(service.get('response'), null, `it should be null`);
18+
});

0 commit comments

Comments
 (0)