Skip to content

Commit

Permalink
fix: modify add_javascript_file method to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Stef-Rousset committed Dec 27, 2024
1 parent 34e6df1 commit 5ad557d
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@ def completed_vote_snippets

def add_javascript_file
if Rails.env.test?
<<~HTML
<script src="/packs-test/js/decidim_handle_voting_complete.js" defer="defer"></script/>
HTML
if File.exist?(Rails.root.join("public", "packs-test", "js", "decidim_handle_voting_complete.js"))
<<~HTML
<script src="/packs-test/js/decidim_handle_voting_complete.js" defer="defer"></script>
HTML
else
<<~HTML
<script src="/decidim-packs/js/decidim_handle_voting_complete.js" defer="defer"></script>
HTML
end
else
<<~HTML
<script src="/decidim-packs/js/decidim_handle_voting_complete.js" defer="defer"></script/>
Expand Down

0 comments on commit 5ad557d

Please sign in to comment.