Skip to content

Commit

Permalink
Merge pull request #10736 from craigteegarden/fix-query-params-regres…
Browse files Browse the repository at this point in the history
…sion-object-controller

[BUGFIX beta] fix broken query params on ObjectController fixes #10733
  • Loading branch information
rwjblue committed Mar 26, 2015
2 parents 47aaf75 + 04980d7 commit 0c057e3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export var objectControllerDeprecation = 'Ember.ObjectController is deprecated,
**/
export default ObjectProxy.extend(ControllerMixin, {
init() {
this._super();
Ember.deprecate(objectControllerDeprecation, this.isGenerated);
}
});
24 changes: 24 additions & 0 deletions packages/ember/tests/routing/query_params_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,30 @@ QUnit.module("Routing w/ Query Params", {
}
});

QUnit.test("Single query params can be set on ObjectController [DEPRECATED]", function() {
expectDeprecation("Ember.ObjectController is deprecated, please use Ember.Controller and use `model.propertyName`.");

Router.map(function() {
this.route("home", { path: '/' });
});

App.HomeController = Ember.ObjectController.extend({
queryParams: ['foo'],
foo: "123"
});

bootApplication();

var controller = container.lookup('controller:home');

setAndFlush(controller, 'foo', '456');

equal(router.get('location.path'), "/?foo=456");

setAndFlush(controller, 'foo', '987');
equal(router.get('location.path'), "/?foo=987");
});

QUnit.test("Single query params can be set", function() {
Router.map(function() {
this.route("home", { path: '/' });
Expand Down

0 comments on commit 0c057e3

Please sign in to comment.