Added contact page test (using zombie.js)
This commit is contained in:
22
test/contact_test.js
Normal file
22
test/contact_test.js
Normal file
@ -0,0 +1,22 @@
|
||||
var chai = require('chai');
|
||||
var should = chai.should();
|
||||
var app = require('../app.js');
|
||||
var Browser = require('zombie');
|
||||
var browser = new Browser({ site: 'http://localhost:3000' });
|
||||
|
||||
|
||||
describe('GET /contact', function() {
|
||||
|
||||
it('should refuse partial form submissions', function(done) {
|
||||
browser.visit('/contact', function() {
|
||||
browser
|
||||
.fill('name', 'Clementine')
|
||||
.fill('message', 'The Walking Dead')
|
||||
.pressButton('Send', function() {
|
||||
browser.success.should.be.true;
|
||||
should.exist(browser.query('.alert-danger'));
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user