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

Fix shipping rate discount factory #54

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Oct 25, 2023

This factory would violate a not-null constraint.

Comment on lines 4 to 13
factory :friendly_shipping_rate_discount, class: "SolidusFriendlyPromotions::ShippingRateDiscount" do
amount { BigDecimal("-4.00") }
shipping_rate
promotion_action { SolidusFriendlyPromotions::Actions::AdjustShipment.new }
promotion_action do
promotion = create(:friendly_promotion)
hundred_percent = SolidusFriendlyPromotions::Calculators::Percent.new(preferred_percent: 100)
SolidusFriendlyPromotions::Actions::AdjustShipment.create!(promotion: promotion, calculator: hundred_percent)
end
label { "10% off" }
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the amount, label, and calculator percentage do not match which leads to confusion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed I think

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly... line 9 var name is hundred_percent still

@mamhoff mamhoff force-pushed the fix-shipping-rate-discount-factory branch from ec861bf to af8920b Compare October 25, 2023 13:51
This factory would violate a not-null constraint.
@mamhoff mamhoff force-pushed the fix-shipping-rate-discount-factory branch from af8920b to e5530c0 Compare October 25, 2023 14:42
Copy link
Collaborator

@davecandlescience davecandlescience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@mamhoff mamhoff merged commit f2fa2f7 into main Oct 25, 2023
@mamhoff mamhoff deleted the fix-shipping-rate-discount-factory branch October 25, 2023 14:51
mamhoff added a commit that referenced this pull request Jul 1, 2024
…actory

Fix shipping rate discount factory
mamhoff added a commit that referenced this pull request Oct 25, 2024
…actory

Fix shipping rate discount factory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants