BUGFIX: don't require env if its not needed

This commit is contained in:
Sam 2014-06-20 10:55:16 +10:00
parent bacd2c0469
commit 51709a0a27

View File

@ -1,11 +1,15 @@
desc "run phantomjs based smoke tests on current build"
task "smoke:test" => :environment do
task "smoke:test" do
phantom_path = File.expand_path('~/phantomjs/bin/phantomjs')
phantom_path = nil unless File.exists?(phantom_path)
phantom_path = phantom_path || 'phantomjs'
url = ENV["URL"] || Discourse.base_url
url = ENV["URL"]
if !url
require "#{Rails.root}/config/environment"
url = Discourse.base_url
end
puts "Testing: #{url}"