Skip to content

Instantly share code, notes, and snippets.

@kgarfinkel
Created May 23, 2014 17:57
Show Gist options
  • Save kgarfinkel/c5daea124b33adc7135b to your computer and use it in GitHub Desktop.
Save kgarfinkel/c5daea124b33adc7135b to your computer and use it in GitHub Desktop.
describe.only('when user is verified and all fields are valid', function () {
var apiUserSession = {
sessionId: 'full-sail',
user: apiUsers[users.user.api_id]
};
given.apiUserCanBeSignedInWith(apiUserSession);
given.anExistingApiUserWith(apiUsers[users.user.api_id]);
before(function (done) {
var form,
self = this;
form = _.map(_.pick(users.user, 'email', 'password'), function (val, key) {
return key + '=' + encodeURIComponent(val);
}).join('&');
this.session.request('post', '/signin')
.set('Content-type', 'application/x-www-form-urlencoded')
.set('Accept', 'text/html')
.send(form)
.expect(302)
.expect('Location', '/')
.end(function (err, res) {
console.log('/signin err ', err);
});
});
shouldUpdateSession({
sessionId: 'full-sail',
email: users.user.email
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment