-
Notifications
You must be signed in to change notification settings - Fork 6
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
Conversation
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed I think
There was a problem hiding this comment.
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
ec861bf
to
af8920b
Compare
This factory would violate a not-null constraint.
af8920b
to
e5530c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
…actory Fix shipping rate discount factory
…actory Fix shipping rate discount factory
This factory would violate a not-null constraint.