partially revert "force domain.yml config in test env"
This doesn't play well with the selenium specs, which modify the test env domain config when spawning a forked server. This reverts the forced config, but keeps the domain_config refactoring. Change-Id: I4ebf8983264adf99c37dd7097d28bdd1773bc2ec Reviewed-on: https://gerrit.instructure.com/6169 Tested-by: Hudson <hudson@instructure.com> Reviewed-by: Jon Jensen <jon@instructure.com>
This commit is contained in:
parent
a59142eb72
commit
a2b972f1d8
|
@ -5,4 +5,5 @@ production:
|
|||
domain: "canvas.example.com"
|
||||
# files_domain: "canvasfiles.example.com"
|
||||
|
||||
# this config file is ignored in the test environment
|
||||
# don't set a domain for the test environment, this is handled automatically by
|
||||
# the specs
|
||||
|
|
|
@ -25,12 +25,8 @@ class HostUrl
|
|||
@@domain_config = nil
|
||||
|
||||
def domain_config
|
||||
if @@domain_config
|
||||
elsif Rails.env.test?
|
||||
# we don't want this config to be changeable in the test environment
|
||||
@@domain_config = { :domain => 'www.example.com' }
|
||||
else
|
||||
@@domain_config = File.exist?("#{RAILS_ROOT}/config/domain.yml") && YAML.load_file("#{RAILS_ROOT}/config/domain.yml")[RAILS_ENV].with_indifferent_access
|
||||
if !@@domain_config
|
||||
@@domain_config = File.exist?("#{RAILS_ROOT}/config/domain.yml") && YAML.load_file("#{RAILS_ROOT}/config/domain.yml")[RAILS_ENV].try(:with_indifferent_access)
|
||||
@@domain_config ||= {}
|
||||
end
|
||||
@@domain_config
|
||||
|
|
Loading…
Reference in New Issue