Also test loginForm submit with email

This commit is contained in:
Johannes Zellner
2015-10-14 14:31:10 +02:00
parent d8b8f5424c
commit 4727187071
2 changed files with 24 additions and 0 deletions

View File

@@ -546,6 +546,28 @@ describe('OAuth2', function () {
});
});
});
it('succeeds with email', function (done) {
startAuthorizationFlow(function (jar) {
var url = SERVER_URL + '/api/v1/session/login?returnTo=' + CLIENT_2.redirectURI;
var data = {
username: USER_0.email,
password: USER_0.password
};
request.post({ url: url, jar: jar, form: data }, function (error, response, body) {
expect(error).to.not.be.ok();
expect(response.statusCode).to.eql(302);
var tmp = urlParse(response.headers.location, true);
expect(tmp.query.redirect_uri).to.eql(CLIENT_2.redirectURI);
expect(tmp.query.client_id).to.eql(CLIENT_2.id);
expect(tmp.query.response_type).to.eql('code');
done();
});
});
});
});
});
});