add delay and trivial 200 code check

This commit is contained in:
Sam Saffron
2013-02-21 16:37:17 +11:00
parent 012941ea62
commit 97ceea8878
2 changed files with 16 additions and 4 deletions

View File

@ -6,7 +6,17 @@ task "smoke:test" => :environment do
phantom_path = phantom_path || 'phantomjs'
url = ENV["URL"] || Discourse.base_url
puts "Testing: #{url}"
require 'open-uri'
require 'net/http'
res = Net::HTTP.get_response(URI.parse(url))
if res.code != "200"
raise "TRIVIAL GET FAILED WITH #{res.code}"
end
results = `#{phantom_path} #{Rails.root}/spec/phantom_js/smoke_test.js #{url}`
puts results