Skip to content

Commit 48ddc93

Browse files
committed
Use newer dependency check
1 parent 798f1c7 commit 48ddc93

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/test_helper.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -682,20 +682,21 @@ class AutomaticDependenciesFromHelpersTest < HelperTest
682682
def test_dependency_added
683683
asset = @assets['url.css']
684684
if asset.respond_to?(:metadata)
685-
paths = asset.metadata[:dependency_paths].map { |p| File.basename(p) }.sort
685+
paths = asset.metadata[:dependencies].select { |uri| uri.start_with?("file-digest") }.map { |p| File.basename(p) }.sort
686686
else
687687
paths = asset.send(:dependency_paths).map {|d| File.basename(d.pathname) }.sort
688688
end
689-
assert_equal ["logo.png", "url.css.erb"], paths
689+
assert_includes paths, "logo.png"
690+
assert_includes paths, "url.css.erb"
690691
end
691692

692693
def test_ignores_missing_dependencies
693694
asset = @assets['error/missing.css']
694695
if asset.respond_to?(:metadata)
695-
paths = asset.metadata[:dependency_paths].map { |p| File.basename(p) }.sort
696+
paths = asset.metadata[:dependencies].select { |uri| uri.start_with?("file-digest") }.map { |p| File.basename(p) }.sort
696697
else
697698
paths = asset.send(:dependency_paths).map {|d| File.basename(d.pathname) }.sort
698699
end
699-
assert_equal ["missing.css.erb"], paths
700+
assert_includes paths, "missing.css.erb"
700701
end
701702
end

0 commit comments

Comments
 (0)