Skip to content

Commit

Permalink
Lint promotino map
Browse files Browse the repository at this point in the history
  • Loading branch information
mamhoff committed Sep 2, 2024
1 parent 349215f commit a2afec0
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions promotions/lib/solidus_promotions/promotion_map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ module SolidusPromotions
actions: {
Spree::Promotion::Actions::CreateAdjustment => ->(old_action) {
calculator = case old_action.calculator
when Spree::Calculator::FlatRate
when Spree::Calculator::FlatRate
SolidusPromotions::Calculators::DistributedAmount.new(preferences: old_action.calculator.preferences)

Check warning on line 65 in promotions/lib/solidus_promotions/promotion_map.rb

View check run for this annotation

Codecov / codecov/patch

promotions/lib/solidus_promotions/promotion_map.rb#L65

Added line #L65 was not covered by tests
when Spree::Calculator::FlatPercentItemTotal
when Spree::Calculator::FlatPercentItemTotal
SolidusPromotions::Calculators::Percent.new(preferred_percent: old_action.calculator.preferred_flat_percent)
end

Expand All @@ -74,17 +74,17 @@ module SolidusPromotions
Spree::Promotion::Actions::CreateItemAdjustments => ->(old_action) {
preferences = old_action.calculator.preferences
calculator = case old_action.calculator
when Spree::Calculator::FlatRate
when Spree::Calculator::FlatRate
SolidusPromotions::Calculators::FlatRate.new(preferences: preferences)
when Spree::Calculator::PercentOnLineItem
when Spree::Calculator::PercentOnLineItem
SolidusPromotions::Calculators::Percent.new(preferences: preferences)

Check warning on line 80 in promotions/lib/solidus_promotions/promotion_map.rb

View check run for this annotation

Codecov / codecov/patch

promotions/lib/solidus_promotions/promotion_map.rb#L80

Added line #L80 was not covered by tests
when Spree::Calculator::FlexiRate
when Spree::Calculator::FlexiRate
SolidusPromotions::Calculators::FlexiRate.new(preferences: preferences)

Check warning on line 82 in promotions/lib/solidus_promotions/promotion_map.rb

View check run for this annotation

Codecov / codecov/patch

promotions/lib/solidus_promotions/promotion_map.rb#L82

Added line #L82 was not covered by tests
when Spree::Calculator::DistributedAmount
when Spree::Calculator::DistributedAmount
SolidusPromotions::Calculators::DistributedAmount.new(preferences: preferences)

Check warning on line 84 in promotions/lib/solidus_promotions/promotion_map.rb

View check run for this annotation

Codecov / codecov/patch

promotions/lib/solidus_promotions/promotion_map.rb#L84

Added line #L84 was not covered by tests
when Spree::Calculator::TieredFlatRate
when Spree::Calculator::TieredFlatRate
SolidusPromotions::Calculators::TieredFlatRate.new(preferences: preferences)

Check warning on line 86 in promotions/lib/solidus_promotions/promotion_map.rb

View check run for this annotation

Codecov / codecov/patch

promotions/lib/solidus_promotions/promotion_map.rb#L86

Added line #L86 was not covered by tests
when Spree::Calculator::TieredPercent
when Spree::Calculator::TieredPercent
SolidusPromotions::Calculators::TieredPercent.new(preferences: preferences)

Check warning on line 88 in promotions/lib/solidus_promotions/promotion_map.rb

View check run for this annotation

Codecov / codecov/patch

promotions/lib/solidus_promotions/promotion_map.rb#L88

Added line #L88 was not covered by tests
end

Expand All @@ -95,17 +95,17 @@ module SolidusPromotions
Spree::Promotion::Actions::CreateQuantityAdjustments => ->(old_action) {
preferences = old_action.calculator.preferences
calculator = case old_action.calculator

Check warning on line 97 in promotions/lib/solidus_promotions/promotion_map.rb

View check run for this annotation

Codecov / codecov/patch

promotions/lib/solidus_promotions/promotion_map.rb#L96-L97

Added lines #L96 - L97 were not covered by tests
when Spree::Calculator::FlatRate
when Spree::Calculator::FlatRate
SolidusPromotions::Calculators::FlatRate.new(preferences: preferences)

Check warning on line 99 in promotions/lib/solidus_promotions/promotion_map.rb

View check run for this annotation

Codecov / codecov/patch

promotions/lib/solidus_promotions/promotion_map.rb#L99

Added line #L99 was not covered by tests
when Spree::Calculator::PercentOnLineItem
when Spree::Calculator::PercentOnLineItem
SolidusPromotions::Calculators::Percent.new(preferences: preferences)

Check warning on line 101 in promotions/lib/solidus_promotions/promotion_map.rb

View check run for this annotation

Codecov / codecov/patch

promotions/lib/solidus_promotions/promotion_map.rb#L101

Added line #L101 was not covered by tests
when Spree::Calculator::FlexiRate
when Spree::Calculator::FlexiRate
SolidusPromotions::Calculators::FlexiRate.new(preferences: preferences)

Check warning on line 103 in promotions/lib/solidus_promotions/promotion_map.rb

View check run for this annotation

Codecov / codecov/patch

promotions/lib/solidus_promotions/promotion_map.rb#L103

Added line #L103 was not covered by tests
when Spree::Calculator::DistributedAmount
when Spree::Calculator::DistributedAmount
SolidusPromotions::Calculators::DistributedAmount.new(preferences: preferences)

Check warning on line 105 in promotions/lib/solidus_promotions/promotion_map.rb

View check run for this annotation

Codecov / codecov/patch

promotions/lib/solidus_promotions/promotion_map.rb#L105

Added line #L105 was not covered by tests
when Spree::Calculator::TieredFlatRate
when Spree::Calculator::TieredFlatRate
SolidusPromotions::Calculators::TieredFlatRate.new(preferences: preferences)

Check warning on line 107 in promotions/lib/solidus_promotions/promotion_map.rb

View check run for this annotation

Codecov / codecov/patch

promotions/lib/solidus_promotions/promotion_map.rb#L107

Added line #L107 was not covered by tests
when Spree::Calculator::TieredPercent
when Spree::Calculator::TieredPercent
SolidusPromotions::Calculators::TieredPercent.new(preferences: preferences)

Check warning on line 109 in promotions/lib/solidus_promotions/promotion_map.rb

View check run for this annotation

Codecov / codecov/patch

promotions/lib/solidus_promotions/promotion_map.rb#L109

Added line #L109 was not covered by tests
end

Expand Down

0 comments on commit a2afec0

Please sign in to comment.