doug-martin / super-request

super-request is a supertest inspired HTTP assertion tester.
http://doug-martin.github.com/super-request/
MIT License
32 stars 12 forks source link

Add auth to REQUEST_OPTIONS #4

Closed mauron85 closed 10 years ago

mauron85 commented 10 years ago

Currently sending authentication header is not possible, because option auth is missing: Following test will fail, because of this:

    before(function (done) {
        request.post('/token')
            .auth({user: user.username + '#' + user.company, pass: user.password})
            .json(true)
            .expect(200)
            .expect('Content-Type', 'application/json')
            .end(function(err, res) {
                if (err) {
                    return done(err);
                }
                token = res.body.access_token;
                console.log(res.body.access_token);
                done();
            });
    });

FIx:

The array of REQUEST_OPTIONS (line 249 in index.js) should be defined

    "static": {
        PORT: 3234,
        REQUEST_OPTIONS: ["auth", "uri", "url", "qs", "headers", "body", "form", "json", "multipart", "followRedirect",
            "followAllRedirects", "maxRedirects", "encoding", "pool", "timeout", "oauth", "strictSSL", "jar", "aws"]
    }
doug-martin commented 10 years ago

Fixed in v0.0.5