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
Add warning threshold to products, mail when below #91 #102
base: master
Are you sure you want to change the base?
Conversation
require 'rails_helper' | ||
|
||
RSpec.describe WarnIfProductQuantityBelowThreshold do | ||
describe '#call' do |
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.
Block has too many lines. [43/25]
@@ -0,0 +1,56 @@ | |||
require 'rails_helper' | |||
|
|||
RSpec.describe WarnIfProductQuantityBelowThreshold do |
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.
Block has too many lines. [45/25]
spec/interactors/pay_cart_spec.rb
Outdated
] | ||
end | ||
let(:pricings) { products.collect { |p| p.pricings.first } } |
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.
Prefer map over collect.
app/mailers/application_mailer.rb
Outdated
default from: 'kdv@kif.rocks' | ||
layout 'mailer' | ||
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.
1 trailing blank lines detected.
AdminMailer.btp_mail(btp: btp).deliver_later if btp.present? | ||
end | ||
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.
1 trailing blank lines detected.
def call | ||
btp = context.cart.cart_items.collect(&:product). | ||
select { |p| p.below_warning_threshold? }. | ||
compact.uniq |
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.
Align compact with context.cart.cart_items.collect(&:product). on line 5.
|
||
def call | ||
btp = context.cart.cart_items.collect(&:product). | ||
select { |p| p.below_warning_threshold? }. |
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.
Align select with context.cart.cart_items.collect(&:product). on line 5.
Pass &:below_warning_threshold? as an argument to select instead of a block.
include Interactor | ||
|
||
def call | ||
btp = context.cart.cart_items.collect(&:product). |
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.
Prefer map over collect.
c16d363
to
19f559c
Compare
19f559c
to
50ab4a8
Compare
No description provided.