/
teaspoon_env.rb
52 lines (41 loc) 路 1.27 KB
/
teaspoon_env.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# frozen_string_literal: true
ENV['RAILS_ENV'] = 'test'
require 'teaspoon/driver/selenium'
require 'webdrivers'
# Similar to setup described in
# https://github.com/jejacks0n/teaspoon/wiki/Micro-Applications
if defined?(DummyApp)
DummyApp::Migrations.auto_migrate
require 'teaspoon-mocha'
Teaspoon.configure do |config|
config.mount_at = "/teaspoon"
config.root = Spree::Backend::Engine.root
config.asset_paths = ["spec/javascripts", "spec/javascripts/stylesheets"]
config.fixture_paths = ["spec/javascripts/fixtures"]
config.driver = :selenium
config.driver_options = {
client_driver: :chrome,
selenium_options: {
options: Selenium::WebDriver::Chrome::Options.new(
args: %w(headless disable-gpu window-size=1920,1440),
),
},
}
config.suite do |suite|
suite.use_framework :mocha, "2.3.3"
suite.matcher = "{spec/javascripts,app/assets}/**/*_spec.js"
suite.helper = "spec_helper"
suite.boot_partial = "/boot"
suite.expand_assets = true
end
end
else
require 'solidus_backend'
require 'teaspoon'
require 'spree/testing_support/dummy_app'
DummyApp.setup(
gem_root: File.expand_path('..', __dir__),
lib_name: 'solidus_backend',
auto_migrate: false
)
end