From 2728e5072364a4a269ce5838e2002f1bf92c0357 Mon Sep 17 00:00:00 2001 From: Sahat Yalkabov Date: Fri, 28 Feb 2014 03:54:06 -0500 Subject: [PATCH] Added contact page test (using zombie.js) --- test/contact_test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/contact_test.js diff --git a/test/contact_test.js b/test/contact_test.js new file mode 100644 index 00000000000000..b407cbd41c2da0 --- /dev/null +++ b/test/contact_test.js @@ -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(); + }); + }); + }); +});