Sha256: 209a6b8add0ffb6f99a9ac5c8acf9e5030d3a4eb3e9929df21a1ce9d0007e89a

Contents?: true

Size: 1.5 KB

Versions: 1

Compression:

Stored size: 1.5 KB

Contents

# frozen_string_literal: true

require File.expand_path("../rails_test_helper", File.dirname(__FILE__))

class RailsFullStackTest < Minitest::Test
  include Capybara::DSL
  include Capybara::Minitest::Assertions

  def setup
    super
    rails_setup
    Coverband.report_coverage
  end

  def teardown
    super
    Capybara.reset_sessions!
    Capybara.use_default_driver
  end

  test "verify erb haml slim support" do
    visit "/dummy_view/show"
    assert_content("I am no dummy view tracker text")
    Coverband.report_coverage
    Coverband.configuration.view_tracker&.report_views_tracked
    visit "/coverage/view_tracker"
    assert_content("Used Views: (1)")
    assert_selector("li.used-views", text: "dummy_view/show.html.erb")
    assert_selector("li.unused-views", text: "dummy_view/show_haml.html.haml")
    assert_selector("li.unused-views", text: "dummy_view/show_slim.html.slim")

    visit "/dummy_view/show_haml"
    assert_content("I am haml text")
    Coverband.report_coverage
    Coverband.configuration.view_tracker&.report_views_tracked
    visit "/coverage/view_tracker"
    assert_content("Used Views: (2)")
    assert_selector("li.used-views", text: "dummy_view/show_haml.html.haml")

    visit "/dummy_view/show_slim"
    assert_content("I am slim text")
    Coverband.report_coverage
    Coverband.configuration.view_tracker&.report_views_tracked
    visit "/coverage/view_tracker"
    assert_content("Used Views: (3)")
    assert_selector("li.used-views", text: "dummy_view/show_slim.html.slim")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
coverband-5.0.2 test/forked/rails_full_stack_views_test.rb