Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin committed Dec 19, 2016
1 parent cee49a3 commit 54e4cae
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions packages/ember/tests/routing/query_params_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,34 @@ moduleFor('Query Params - main', class extends QueryParamTestCase {
});
}

['@test multiple QP value changes only cause a single model refresh'](assert) {
assert.expect(2);

this.setSingleQPController('index', 'alex', 'lol');
this.setSingleQPController('index', 'steely', 'lel');

let refreshCount = 0;
this.registerRoute('index', Route.extend({
queryParams: {
alex: {
refreshModel: true
},
steely: {
refreshModel: true
}
},
refresh() {
refreshCount++;
}
}));

return this.visitAndAssert('/').then(() => {
let indexController = this.getController('index');
run(indexController, 'setProperties', { alex: 'fran', steely: 'david' });
assert.equal(refreshCount, 1, 'index refresh hook only run once');
});
}

['@test refreshModel does not cause a second transition during app boot '](assert) {
assert.expect(1);

Expand Down

0 comments on commit 54e4cae

Please sign in to comment.