shakapacker 6.2.1 → 6.3.0.pre.rc.1

Sign up to get free protection for your applications and to get access to all the features.
data/test/helper_test.rb CHANGED
@@ -115,6 +115,28 @@ class HelperTest < ActionView::TestCase
115
115
  javascript_pack_tag("application", "bootstrap", defer: false)
116
116
  end
117
117
 
118
+ def test_javascript_pack_with_append
119
+ append_javascript_pack_tag("bootstrap", defer: false)
120
+ assert_equal \
121
+ %(<script src="/packs/vendors~application~bootstrap-c20632e7baf2c81200d3.chunk.js" defer="defer"></script>\n) +
122
+ %(<script src="/packs/vendors~application-e55f2aae30c07fb6d82a.chunk.js" defer="defer"></script>\n) +
123
+ %(<script src="/packs/application-k344a6d59eef8632c9d1.js" defer="defer"></script>\n) +
124
+ %(<script src="/packs/bootstrap-300631c4f0e0f9c865bc.js"></script>),
125
+ javascript_pack_tag("application")
126
+ end
127
+
128
+ def test_append_javascript_pack_tag_raises
129
+ error = assert_raises do
130
+ javascript_pack_tag("application")
131
+ append_javascript_pack_tag("bootstrap", defer: false)
132
+ end
133
+
134
+ assert_equal \
135
+ "You can only call append_javascript_pack_tag before javascript_pack_tag helper. " +
136
+ "Please refer to https://github.com/shakacode/shakapacker/blob/master/README.md#usage for the usage guide",
137
+ error.message
138
+ end
139
+
118
140
  def test_javascript_pack_tag_splat
119
141
  assert_equal \
120
142
  %(<script src="/packs/vendors~application~bootstrap-c20632e7baf2c81200d3.chunk.js" defer="defer"></script>\n) +
@@ -8,7 +8,7 @@ class ManifestTest < Minitest::Test
8
8
  Webpacker.manifest.lookup!(asset_file)
9
9
  end
10
10
 
11
- assert_match "Webpacker can't find #{asset_file} in #{manifest_path}", error.message
11
+ assert_match "Shakapacker can't find #{asset_file} in #{manifest_path}", error.message
12
12
  end
13
13
 
14
14
  def test_lookup_with_type_exception!
@@ -18,7 +18,7 @@ class ManifestTest < Minitest::Test
18
18
  Webpacker.manifest.lookup!(asset_file, type: :javascript)
19
19
  end
20
20
 
21
- assert_match "Webpacker can't find #{asset_file}.js in #{manifest_path}", error.message
21
+ assert_match "Shakapacker can't find #{asset_file}.js in #{manifest_path}", error.message
22
22
  end
23
23
 
24
24
  def test_lookup_success!
@@ -60,7 +60,7 @@ class ManifestTest < Minitest::Test
60
60
  Webpacker.manifest.lookup_pack_with_chunks!(asset_file, type: :javascript)
61
61
  end
62
62
 
63
- assert_match "Webpacker can't find #{asset_file}.js in #{manifest_path}", error.message
63
+ assert_match "Shakapacker can't find #{asset_file}.js in #{manifest_path}", error.message
64
64
  end
65
65
 
66
66
  def test_lookup_entrypoint
@@ -0,0 +1,7 @@
1
+ # Note: You must restart bin/webpacker-dev-server for changes to take effect
2
+
3
+ default: &default
4
+ webpacker_precompile: false
5
+
6
+ production:
7
+ <<: *default