From 6daef624c3f43938ecddbd9fd6f13299ab08c186 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 10 Apr 2014 16:57:23 +1000 Subject: [PATCH] BUGFIX: smoke test was broken --- lib/tasks/smoke_test.rake | 7 +++++-- spec/phantom_js/smoke_test.js | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/tasks/smoke_test.rake b/lib/tasks/smoke_test.rake index ae86008de..40506ce99 100644 --- a/lib/tasks/smoke_test.rake +++ b/lib/tasks/smoke_test.rake @@ -17,9 +17,12 @@ task "smoke:test" => :environment do raise "TRIVIAL GET FAILED WITH #{res.code}" end - results = `#{phantom_path} #{Rails.root}/spec/phantom_js/smoke_test.js #{url}` + results = "" + IO.popen("#{phantom_path} #{Rails.root}/spec/phantom_js/smoke_test.js #{url}").each do |line| + puts line + results << line + end - puts results if results !~ /ALL PASSED/ raise "FAILED" end diff --git a/spec/phantom_js/smoke_test.js b/spec/phantom_js/smoke_test.js index b60f85d60..e1a307124 100644 --- a/spec/phantom_js/smoke_test.js +++ b/spec/phantom_js/smoke_test.js @@ -101,8 +101,8 @@ page.runTests = function(){ navigate("navigate to first topic", function(){ Em.run.later(function(){ - if ($('.main-link a:first').length > 0) { - $('.main-link a:first').click(); // topic list page + if ($('.main-link > a:first').length > 0) { + $('.main-link > a:first').click(); // topic list page } else { $('.featured-topic a.title:first').click(); // categories page }