Skip to content

Commit

Permalink
Merge pull request #201 from arjansingh/error
Browse files Browse the repository at this point in the history
Do not compute FastBootService.request in the browser
  • Loading branch information
danmcclain committed May 31, 2016
2 parents 121aa03 + 60690b4 commit 377748d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/services/fastboot.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default Ember.Service.extend({
response: readOnly('_fastbootInfo.response'),

request: computed(function() {
if (!get(this, 'isFastBoot')) return null;
return RequestObject.create({ request: get(this, '_fastbootInfo.request') });
}),

Expand Down
18 changes: 18 additions & 0 deletions tests/unit/services/fastboot-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { moduleFor, test } from 'ember-qunit';

moduleFor('service:fastboot', 'Unit | Service | fastboot in the browser', {});

test('isFastBoot', function(assert) {
let service = this.subject();
assert.equal(service.get('isFastBoot'), false, `it should be false`);
});

test('request', function(assert) {
let service = this.subject();
assert.equal(service.get('request'), null, `it should be null`);
});

test('response', function(assert) {
let service = this.subject();
assert.equal(service.get('response'), null, `it should be null`);
});

0 comments on commit 377748d

Please sign in to comment.