Sha256: f689a6db84e95f1a88320a836b16cfd473d29618fce4fd0d31fabbe514fb5d92

Contents?: true

Size: 839 Bytes

Versions: 1

Compression:

Stored size: 839 Bytes

Contents

require "webpacker_test"

class HelperTest < ActionView::TestCase
  def setup
    @view = ActionView::Base.new
    @view.extend WebpackerHelpers::Helper
  end

  def test_asset_pack_path
    assert_equal @view.asset_pack_path("bootstrap.js"), "/webpack/test/bootstrap-300631c4f0e0f9c865bc.js"
    assert_equal @view.asset_pack_path("bootstrap.css"), "/webpack/test/bootstrap-c38deda30895059837cf.css"
  end

  def test_javascript_pack_tag
    script = %(<script src="/webpack/test/bootstrap-300631c4f0e0f9c865bc.js"></script>)
    assert_equal @view.javascript_pack_tag("bootstrap.js"), script
  end

  def test_stylesheet_pack_tag
    expected_style = %(<link rel="stylesheet" media="screen" href="/webpack/test/bootstrap-c38deda30895059837cf.css" />)
    assert_equal @view.stylesheet_pack_tag("bootstrap.css"), expected_style
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
webpacker_helpers-3.0.0.beta.1 test/helper_test.rb