From ca5b1e742266a40619e3ac497eba93b4999a3a25 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 19 Aug 2014 14:35:20 +0100 Subject: [PATCH] cleaned up smoke tests --- .../web/app/coffee/infrastructure/Server.coffee | 1 - services/web/test/smoke/coffee/SmokeTests.coffee | 13 +++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/services/web/app/coffee/infrastructure/Server.coffee b/services/web/app/coffee/infrastructure/Server.coffee index 344be3bd73..264360c81c 100644 --- a/services/web/app/coffee/infrastructure/Server.coffee +++ b/services/web/app/coffee/infrastructure/Server.coffee @@ -68,7 +68,6 @@ app.configure () -> next() app.use (req, res, next) -> - console.log req.sessionID for route in ignoreCsrfRoutes if route.method == req.method?.toLowerCase() and route.match(req.path) return next() diff --git a/services/web/test/smoke/coffee/SmokeTests.coffee b/services/web/test/smoke/coffee/SmokeTests.coffee index ac2b4918f1..c29239b88e 100644 --- a/services/web/test/smoke/coffee/SmokeTests.coffee +++ b/services/web/test/smoke/coffee/SmokeTests.coffee @@ -7,20 +7,25 @@ expect = chai.expect Settings = require "settings-sharelatex" port = Settings.internal?.web?.port or Settings.port or 3000 cookeFilePath = "/tmp/smoke-test-cookie-#{port}.txt" -buildUrl = (path) -> "-b #{cookeFilePath} -c #{cookeFilePath} --resolve 'smoke#{Settings.cookieDomain}:#{port}:127.0.0.1' http://smoke#{Settings.cookieDomain}:#{port}/#{path}?setLng=en" +buildUrl = (path) -> " -b #{cookeFilePath} -c #{cookeFilePath} -H 'X-Forwarded-Proto: https' --resolve 'smoke#{Settings.cookieDomain}:#{port}:127.0.0.1' http://smoke#{Settings.cookieDomain}:#{port}/#{path}?setLng=en" describe "Opening", -> before (done) -> - command = "curl #{buildUrl('register')}" + command = """ + curl #{buildUrl('register')} + """ child.exec command, (err, stdout, stderr)-> if err? then done(err) csrf = stdout.match("")[1] + command = """ curl -H "Content-Type: application/json" -d '{"_csrf":"#{csrf}", "email":"#{Settings.smokeTest.user}", "password":"#{Settings.smokeTest.password}"}' #{buildUrl('register')} """ + child.exec command, (err, stdout, stderr)-> + done(err) after (done)-> @@ -30,7 +35,7 @@ describe "Opening", -> it "a project", (done) -> @timeout(4000) command = """ - curl -H 'X-Forwarded-Proto: https' -v #{buildUrl("project/#{Settings.smokeTest.projectId}")} + curl -v #{buildUrl("project/#{Settings.smokeTest.projectId}")} """ child.exec command, (error, stdout, stderr)-> expect(error, "smoke test: error in getting project").to.not.exist @@ -47,7 +52,7 @@ describe "Opening", -> it "the project list", (done) -> @timeout(4000) command = """ - curl -H 'X-Forwarded-Proto: https' -v #{buildUrl("project")} + curl -v #{buildUrl("project")} """ child.exec command, (error, stdout, stderr)->