Sha256: 81b899d47fde4af15e7638f91a71e78f76201fac8f78e2ee0c8376d7adaefc5a

Contents?: true

Size: 1.08 KB

Versions: 13

Compression:

Stored size: 1.08 KB

Contents

# tiny patch to add middlewares after the initialization
# 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

def Locomotive.configure_for_test(force = false)
  Locomotive.configure do |config|
    config.multi_sites do |multi_sites|
      multi_sites.domain = 'example.com'
      multi_sites.reserved_subdomains = %w(www admin locomotive email blog webmail mail support help site sites)
    end

    config.enable_logs = true

    config.csrf_protection = true

    config.theme_assets_checksum = true

    config.enable_admin_ssl = false

    if force
      Locomotive.define_subdomain_and_domains_options

      Locomotive.send(:remove_const, 'Site') if Locomotive.const_defined?('Site')
      load 'locomotive/site.rb'

      FactoryGirl.factories.clear
      load File.join(File.dirname(__FILE__), 'factories.rb')
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
locomotive_cms-2.5.7 spec/support/locomotive.rb
locomotive_cms-2.5.6 spec/support/locomotive.rb
locomotive_cms-2.5.6.rc2 spec/support/locomotive.rb
locomotive_cms-2.5.6.rc1 spec/support/locomotive.rb
locomotive_cms-2.5.5 spec/support/locomotive.rb
locomotive_cms-2.5.4 spec/support/locomotive.rb
locomotive_cms-2.5.3 spec/support/locomotive.rb
locomotive_cms-2.5.2 spec/support/locomotive.rb
locomotive_cms-2.5.1 spec/support/locomotive.rb
locomotive_cms-2.5.0 spec/support/locomotive.rb
locomotive_cms-2.5.0.rc3 spec/support/locomotive.rb
locomotive_cms-2.5.0.rc2 spec/support/locomotive.rb
locomotive_cms-2.5.0.rc1 spec/support/locomotive.rb