Class: MinitestShopifyThemes::ViewTest

Inherits:
LiquidTest
  • Object
show all
Includes:
Capybara::DSL
Defined in:
lib/minitest_shopify_themes/view_test.rb

Constant Summary collapse

VIEWS_DIR =
Dir.mktmpdir

Instance Method Summary collapse

Methods inherited from LiquidTest

#deep_stringify_keys, #html, #page, #render_liquid, #text

Instance Method Details

#renderObject



21
22
23
24
25
26
# File 'lib/minitest_shopify_themes/view_test.rb', line 21

def render(**)
  super
  host_page do |path|
    visit path
  end
end

#setupObject



8
9
10
11
12
13
14
# File 'lib/minitest_shopify_themes/view_test.rb', line 8

def setup
  Capybara.current_driver = MinitestShopifyThemes.configuration.selenium_driver
  Capybara.app ||= Rack::Lint.new Rack::Cascade.new [
    Rack::Files.new(VIEWS_DIR),
    Rack::URLMap.new("/assets" => Rack::Files.new(MinitestShopifyThemes.configuration.assets_dir)),
  ]
end

#teardownObject



16
17
18
19
# File 'lib/minitest_shopify_themes/view_test.rb', line 16

def teardown
  Capybara.reset_sessions!
  Capybara.use_default_driver
end