Skip to content

Commit 0c14dd6

Browse files
committed
Fix warnings of ambiguous /
1 parent e8dd767 commit 0c14dd6

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

test/importmap_tags_helper_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ def content_security_policy_nonce
5252
test "tags have no nonce if CSP is not configured" do
5353
@request = FakeRequest.new
5454

55-
assert_no_match /nonce/, javascript_importmap_tags("application")
55+
assert_no_match(/nonce/, javascript_importmap_tags("application"))
5656
ensure
5757
@request = nil
5858
end
5959

6060
test "tags have nonce if CSP is configured" do
6161
@request = FakeRequest.new("iyhD0Yc0W+c=")
6262

63-
assert_match /nonce="iyhD0Yc0W\+c="/, javascript_inline_importmap_tag
64-
assert_match /nonce="iyhD0Yc0W\+c="/, javascript_import_module_tag("application")
65-
assert_match /nonce="iyhD0Yc0W\+c="/, javascript_importmap_module_preload_tags
63+
assert_match(/nonce="iyhD0Yc0W\+c="/, javascript_inline_importmap_tag)
64+
assert_match(/nonce="iyhD0Yc0W\+c="/, javascript_import_module_tag("application"))
65+
assert_match(/nonce="iyhD0Yc0W\+c="/, javascript_importmap_module_preload_tags)
6666
ensure
6767
@request = nil
6868
end

test/importmap_test.rb

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -99,35 +99,35 @@ def setup
9999

100100
test "preloaded modules are included in preload tags when no entry_point specified" do
101101
preloading_module_paths = @importmap.preloaded_module_paths(resolver: ApplicationController.helpers).to_s
102-
assert_match /md5/, preloading_module_paths
103-
assert_match /goodbye_controller/, preloading_module_paths
104-
assert_match /leaflet/, preloading_module_paths
105-
assert_no_match /application/, preloading_module_paths
106-
assert_no_match /tinymce/, preloading_module_paths
102+
assert_match(/md5/, preloading_module_paths)
103+
assert_match(/goodbye_controller/, preloading_module_paths)
104+
assert_match(/leaflet/, preloading_module_paths)
105+
assert_no_match(/application/, preloading_module_paths)
106+
assert_no_match(/tinymce/, preloading_module_paths)
107107
end
108108

109109
test "preloaded modules are included in preload tags based on single entry_point provided" do
110110
preloading_module_paths = @importmap.preloaded_module_paths(resolver: ApplicationController.helpers, entry_point: "alternate").to_s
111-
assert_no_match /leaflet/, preloading_module_paths
112-
assert_match /tinymce/, preloading_module_paths
113-
assert_match /chartkick/, preloading_module_paths
114-
assert_match /md5/, preloading_module_paths
115-
assert_match /goodbye_controller/, preloading_module_paths
116-
assert_no_match /application/, preloading_module_paths
111+
assert_no_match(/leaflet/, preloading_module_paths)
112+
assert_match(/tinymce/, preloading_module_paths)
113+
assert_match(/chartkick/, preloading_module_paths)
114+
assert_match(/md5/, preloading_module_paths)
115+
assert_match(/goodbye_controller/, preloading_module_paths)
116+
assert_no_match(/application/, preloading_module_paths)
117117
end
118118

119119
test "preloaded modules are included in preload tags based on multiple entry_points provided" do
120120
preloading_module_paths = @importmap.preloaded_module_paths(resolver: ApplicationController.helpers, entry_point: ["application", "alternate"]).to_s
121-
assert_match /leaflet/, preloading_module_paths
122-
assert_match /tinymce/, preloading_module_paths
123-
assert_match /chartkick/, preloading_module_paths
124-
assert_match /md5/, preloading_module_paths
125-
assert_match /goodbye_controller/, preloading_module_paths
126-
assert_no_match /application/, preloading_module_paths
121+
assert_match(/leaflet/, preloading_module_paths)
122+
assert_match(/tinymce/, preloading_module_paths)
123+
assert_match(/chartkick/, preloading_module_paths)
124+
assert_match(/md5/, preloading_module_paths)
125+
assert_match(/goodbye_controller/, preloading_module_paths)
126+
assert_no_match(/application/, preloading_module_paths)
127127
end
128128

129129
test "digest" do
130-
assert_match /^\w{40}$/, @importmap.digest(resolver: ApplicationController.helpers)
130+
assert_match(/^\w{40}$/, @importmap.digest(resolver: ApplicationController.helpers))
131131
end
132132

133133
test "separate caches" do

0 commit comments

Comments
 (0)