Skip to content

Commit

Permalink
keithwhor#300: implement feedback from PR keithwhor#301
Browse files Browse the repository at this point in the history
  • Loading branch information
ranchodeluxe committed Nov 6, 2016
1 parent 17ff947 commit 4c37de3
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions core/mocha/endpoint_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class EndpointRequest {
'::1',
this.url,
method,
Object.keys(headers || {}).reduce(function(accum, curr){ headers[curr.toLowerCase()] = headers[curr]; return headers;},{}),
Object.keys(headers || {}).reduce(function(a, c){ headers[c.toLowerCase()] = headers[c]; return headers;},{}),
body
),
(err, status, headers, body) => {
Expand All @@ -50,25 +50,37 @@ class EndpointRequest {

}

get(callback, headers) {
get(callback) {

this.mock('GET', null, headers, callback);
this.mock('GET', null, null, callback);

}

del(callback, headers) {
del(callback) {

this.mock('DELETE', null, headers, callback);
this.mock('DELETE', null, null, callback);

}

post(body, callback, headers) {
post(body, callback) {

this.mock('POST', body, {'Content-Type': 'application/json'}, callback);

}

postHead(body, headers, callback){

this.mock('POST', body, headers, callback);

}

put(body, callback, headers) {
put(body, callback) {

this.mock('PUT', body, {'Content-Type': 'application/json'}, callback);

}

putHead(body, headers, callback) {

this.mock('PUT', body, headers, callback);

Expand Down

0 comments on commit 4c37de3

Please sign in to comment.