Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX beta] fix broken query params on ObjectController fixes #10733 #10736

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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