Initial commit.
This commit is contained in:
commit
b48a4e92e1
169 changed files with 7538 additions and 0 deletions
26
test/web/user.spec.js
Normal file
26
test/web/user.spec.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
import app from '../../web/app';
|
||||
import { agent } from 'supertest';
|
||||
|
||||
const request = agent(app.listen());
|
||||
|
||||
describe('hostr-web user', function() {
|
||||
describe('when POST /signin with invalid credentials', function() {
|
||||
it('should not redirect to /', function(done) {
|
||||
request
|
||||
.post('/signin')
|
||||
.send({'email': 'test@hostr.co', 'password': 'test-passworddeded'})
|
||||
.expect(200, done);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when POST /signin with valid credentials', function() {
|
||||
it('should redirect to /', function(done) {
|
||||
request
|
||||
.post('/signin')
|
||||
.send({'email': 'test@hostr.co', 'password': 'test-password'})
|
||||
.expect(302)
|
||||
.expect('Location', '/')
|
||||
.end(done);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue