2011-06-28 13:38:13 +00:00
|
|
|
# tiny patch to add middlewares after the initialization
|
2012-02-16 00:32:37 +00:00
|
|
|
# module Rails
|
|
|
|
# class Application < Engine
|
|
|
|
# def app
|
|
|
|
# @app ||= begin
|
|
|
|
# if config.middleware.respond_to?(:merge_into)
|
|
|
|
# config.middleware = config.middleware.merge_into(default_middleware_stack)
|
|
|
|
# end
|
|
|
|
# config.middleware.build(routes)
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
# end
|
2011-06-28 13:38:13 +00:00
|
|
|
|
|
|
|
|
2011-04-05 00:18:17 +00:00
|
|
|
def Locomotive.configure_for_test(force = false)
|
2011-04-03 23:59:41 +00:00
|
|
|
Locomotive.configure do |config|
|
|
|
|
config.multi_sites do |multi_sites|
|
|
|
|
multi_sites.domain = 'example.com'
|
2012-02-18 00:57:06 +00:00
|
|
|
multi_sites.reserved_subdomains = %w(www admin locomotive email blog webmail mail support help site sites)
|
2010-05-30 23:57:33 +00:00
|
|
|
end
|
2011-04-05 00:18:17 +00:00
|
|
|
|
2011-04-03 23:59:41 +00:00
|
|
|
config.enable_logs = true
|
2011-04-05 00:18:17 +00:00
|
|
|
|
2012-05-23 22:03:21 +00:00
|
|
|
config.csrf_protection = true
|
|
|
|
|
2011-04-05 00:18:17 +00:00
|
|
|
if force
|
|
|
|
Locomotive.define_subdomain_and_domains_options
|
|
|
|
|
2011-11-25 12:45:16 +00:00
|
|
|
Locomotive.send(:remove_const, 'Site') if Locomotive.const_defined?('Site')
|
2011-11-20 11:47:41 +00:00
|
|
|
load 'locomotive/site.rb'
|
2011-04-05 00:18:17 +00:00
|
|
|
|
2011-07-26 21:11:43 +00:00
|
|
|
FactoryGirl.factories.clear
|
2011-11-25 12:45:16 +00:00
|
|
|
load File.join(File.dirname(__FILE__), 'factories.rb')
|
2011-04-05 00:18:17 +00:00
|
|
|
end
|
2010-05-30 23:57:33 +00:00
|
|
|
end
|
2011-11-20 11:47:41 +00:00
|
|
|
end
|