Module: DummyApp

Defined in:
lib/spree/testing_support/dummy_app.rb,
lib/spree/testing_support/dummy_app/migrations.rb,
lib/spree/testing_support/dummy_app/rake_tasks.rb

Defined Under Namespace

Modules: Migrations Classes: Application, RakeTasks

Class Method Summary collapse

Class Method Details

.setup(gem_root:, lib_name:, auto_migrate: true) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/spree/testing_support/dummy_app.rb', line 27

def self.setup(gem_root:, lib_name:, auto_migrate: true)
  ENV["LIB_NAME"] = lib_name
  DummyApp::Application.config.root = File.join(gem_root, 'spec', 'dummy')

  DummyApp::Application.initialize!

  DummyApp::Application.routes.draw do
    mount Spree::Core::Engine, at: '/'
  end

  if auto_migrate
    DummyApp::Migrations.auto_migrate
  end
end