Skip to content

Commit

Permalink
Fix failing solidus_admin thumbnail spec
Browse files Browse the repository at this point in the history
Failure: /spec/components/solidus_admin/ui/thumbnail/component_spec.rb:6

Error:

/home/circleci/solidus/admin/spec/components/previews/solidus_admin/ui/thumbnail/component_preview/overview.html.erb:53:
numbered parameter is already used in
/home/circleci/solidus/admin/spec/components/previews/solidus_admin/ui/thumbnail/component_preview/overview.html.erb:52:
outer block here Failure/Error: <% image = Spree::Image.new.tap {
_1.define_singleton_method(:attachment) { attachment } } %>

By replaing the second instance of numbered params, we can avoid this
error with no behavioural or functional changes to the code.

Interestingly though, it was only failing on 2 out of our 8 spec runs,
and it did so consistently.

(cherry picked from commit 7176948)
  • Loading branch information
MadelineCollier committed Aug 27, 2024
1 parent aa3e731 commit 1c01a42
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<div class="flex gap-4">
<% product = Spree::Product.new(name: "A good product") %>
<% attachment = Object.new.tap { def _1.url(*) "https://placekitten.com/280/200"; end } %>
<% image = Spree::Image.new.tap { _1.define_singleton_method(:attachment) { attachment } } %>
<% image = Spree::Image.new.tap { |img| img.define_singleton_method(:attachment) { attachment } } %>
<% [
Spree::PromotionAction.new,
Spree::UnitCancel.new,
Expand Down

0 comments on commit 1c01a42

Please sign in to comment.