From 62b00bf88a47231cc44a5148a01ed8770e9c1483 Mon Sep 17 00:00:00 2001 From: Carlos Vieira Date: Fri, 27 Jan 2017 11:56:27 -0200 Subject: [PATCH] Adicionando teste para existência da fonte --- test/app.js | 5 +++++ test/zombie-test.js | 10 +++++++++- views/opensansbold.ejs | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 views/opensansbold.ejs diff --git a/test/app.js b/test/app.js index ea3f784..30815ae 100644 --- a/test/app.js +++ b/test/app.js @@ -22,6 +22,11 @@ app.get('/jquery.js', function (req, res) res.render('jquery'); }); +app.get('/static/opensans-bold.woff', function (req, res) +{ + res.render('opensansbold'); +}); + // instead of starting the application here, export the app so that it can // be loaded differently based on the use case (running the app vs testing) module.exports = app; diff --git a/test/zombie-test.js b/test/zombie-test.js index b96c2d7..b7ab9f0 100644 --- a/test/zombie-test.js +++ b/test/zombie-test.js @@ -6,8 +6,9 @@ var expect = require("chai").expect, app = require("./app"); describe("Testes de conteúdo de HTML da barra", function() { - var server, browser, barraUrl; + var server, browser, barraUrl, barraFonte; barraUrl = "http://localhost:3000/"; + barraFonte = "http://localhost:3000/static/opensans-bold.woff"; before(function() { server = app.listen(3000); }); @@ -38,6 +39,13 @@ describe("Testes de conteúdo de HTML da barra", function() { }); }); + it("A fonte deve estar respondendo", function(done) { + browser.visit(barraFonte, function() { + expect(browser.response.status).to.equal(200); + done(); + }); + }); + it("a barra deve ter o css correto para visualizacao maior que 960px"); it("a barra deve ter o css correto para visualização menor que 960px"); diff --git a/views/opensansbold.ejs b/views/opensansbold.ejs new file mode 100644 index 0000000..f17f27b --- /dev/null +++ b/views/opensansbold.ejs @@ -0,0 +1 @@ +<% include ../app/static/opensans-bold.woff %> -- libgit2 0.21.2