Sha256: 477a7a6e50b57c07fa9091dd52632be2c37a68b3ff36feb7edc22270bb4bcf8c

Contents?: true

Size: 786 Bytes

Versions: 4

Compression:

Stored size: 786 Bytes

Contents

require "webpacker_test"

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

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

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

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

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
webpacker-legacy-0.1.2 test/helper_test.rb
webpacker-legacy-0.1.1 test/helper_test.rb
webpacker-legacy-0.1.0 test/helper_test.rb
webpacker-2.0 test/helper_test.rb