Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix default host for tests

Change-Id: I88b59c05a39803c95e3d306b9f47b7ef0450d4c8
Reviewed-on: https://gerrit.instructure.com/2429
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
  • Loading branch information...
commit bedb1d878e8325994658ac83241e6b235b43004c 1 parent 0dc9cb5
@jtolds jtolds authored
Showing with 13 additions and 2 deletions.
  1. +8 −1 lib/host_url.rb
  2. +5 −1 spec/selenium/common.rb
View
9 lib/host_url.rb
@@ -44,11 +44,18 @@ def file_host(account)
res = @@file_host = @@domain_config[:files_domain] if @@domain_config && @@domain_config.has_key?(:files_domain)
Rails.logger.warn("No separate files host specified for account id #{account.id}. This is a potential security risk.") unless res
end
- res ||= default_host
+ res ||= @@file_host = default_host
end
def outgoing_email_address(preferred_user="notifications")
@outgoing_email_address.presence || "#{preferred_user}@#{outgoing_email_domain}"
end
+
+ def file_host=(val)
+ @@file_host = val
+ end
+ def default_host=(val)
+ @@default_host = val
+ end
end
end
View
6 spec/selenium/common.rb
@@ -36,11 +36,12 @@ def setup_selenium
end
def self.start_webrick_server
+ HostUrl.default_host = "#{SERVER_IP}:#{SERVER_PORT}"
+ HostUrl.file_host = "#{SERVER_IP}:#{SERVER_PORT}"
server = SpecFriendlyWEBrickServer
app = Rack::Builder.new do
use Rails::Rack::Debugger
map '/' do
-
use Rails::Rack::Static
run ActionController::Dispatcher.new
end
@@ -48,7 +49,10 @@ def self.start_webrick_server
server.run(app, :Port => SERVER_PORT, :AccessLog => [])
shutdown = lambda do
server.shutdown
+ HostUrl.default_host = nil
+ HostUrl.file_host = nil
end
+ at_exit { shutdown.call }
return shutdown
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.