Add queryParams to request object #3

Merged
merged 2 commits into from May 17, 2014

Conversation

Projects
None yet
2 participants
@ahx
Contributor

ahx commented May 12, 2014

This adds a queryParams to the request object that is passed to the handler function. This is useful if you want to use the URLs query string parameters inside your handler function.

USAGE / TEST:

test("queryParams are passed", function(){
  var params;
  pretender.get('/some/path', function(request){
    params = request.queryParams
  });

  $.ajax({url: '/some/path?zulu=nation'});
  equal(params.zulu, 'nation');
});

trek added a commit that referenced this pull request May 17, 2014

Merge pull request #3 from ahx/pass-query-params
Add queryParams to request object

@trek trek merged commit d509405 into pretenderjs:master May 17, 2014

@trek

This comment has been minimized.

Show comment Hide comment
@trek

trek May 17, 2014

Member

❤️

Member

trek commented May 17, 2014

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment