Beispiel #1
0
 it("uses the given options", function () {
     var options = {};
     var req = request.normalizeRequest({
         options: options
     });
     expect(req.options).toBe(options);
 });
Beispiel #2
0
 it("uses the given headers", function () {
     var headers = {};
     var req = request.normalizeRequest({
         headers: headers
     });
     expect(req.headers).toBe(headers);
 });
Beispiel #3
0
 it("defaults options to an empty object", function () {
     var req = request.normalizeRequest("pass");
     expect(req.options).toEqual({});
 });
Beispiel #4
0
 it("uses the given method property", function () {
     var req = request.normalizeRequest({
         method: "POST"
     });
     expect(req.method).toEqual("POST");
 });
Beispiel #5
0
 it("defaults method to GET", function () {
     var req = request.normalizeRequest("pass");
     expect(req.method).toEqual("GET");
 });
Beispiel #6
0
 it("converts a string into an object with a url property", function () {
     var req = request.normalizeRequest("pass");
     expect(typeof req).toEqual("object");
     expect(req.url).toEqual("pass");
 });