Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vite_picture_tag coverage for pre-7.1 test paths #472

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions test/helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,19 @@ def test_vite_image_tag
}
end

if Rails.gem_version >= Gem::Version.new('7.1.0')
def test_vite_picture_tag
def test_vite_picture_tag
if Rails.gem_version >= Gem::Version.new('7.1.0')
assert_equal <<~HTML.gsub(/\n\s*/, ''), vite_picture_tag('images/logo.svg', 'images/logo.png', class: 'test', image: { alt: 'Logo' })
<picture class="test">
<source srcset="/vite-production/assets/logo.322aae0c.svg" type="image/svg+xml" />
<source srcset="/vite-production/assets/logo.f42fb7ea.png" type="image/png" />
<img alt="Logo" src="/vite-production/assets/logo.f42fb7ea.png" />
</picture>
HTML
else
assert_raises(NotImplementedError, /vite_picture_tag/) {
vite_picture_tag
}
end
end
end