1
0
Fork 0
mirror of https://github.com/kbparagua/paloma synced 2023-03-27 23:21:17 -04:00

do not put request data on params

This commit is contained in:
kbparagua 2016-03-25 13:23:15 +08:00
parent 9221b07d38
commit 6d9e22e85f
2 changed files with 8 additions and 10 deletions

View file

@ -32,13 +32,14 @@ describe('Paloma.ControllerBuilder', function(){
});
it("initializes controller instance's params", function(){
var expectedParams = {_controller: 'Test', _action: 'show', a: 1, b: 2};
var expectedParams = {a: 1, b: 2};
var correct = true;
for (var k in expectedParams){
if (controller.params[k] != expectedParams[k])
correct = false;
}
for (var k in expectedParams)
if (controller.params[k] != expectedParams[k]) correct = false;
for (var k in controller.params)
if (expectedParams[k] != controller.params[k]) correct = false;
expect(correct).toBeTruthy();
});

View file

@ -19,10 +19,7 @@ Paloma.ControllerBuilder.prototype = {
},
_buildParams: function(){
var params = {
_controller: this.options.controller,
_action: this.options.action
};
var params = {};
for (var k in this.options.params)
if (this.options.params.hasOwnProperty(k))