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

Add warning threshold to products, mail when below #91 #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thegcat
Copy link
Collaborator

@thegcat thegcat commented Jun 15, 2017

No description provided.

require 'rails_helper'

RSpec.describe WarnIfProductQuantityBelowThreshold do
describe '#call' do

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

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]

]
end
let(:pricings) { products.collect { |p| p.pricings.first } }

Choose a reason for hiding this comment

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

Prefer map over collect.

default from: 'kdv@kif.rocks'
layout 'mailer'
end

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

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

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? }.

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).

Choose a reason for hiding this comment

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

Prefer map over collect.

@thegcat thegcat force-pushed the feature/91-threshold_warnings branch from c16d363 to 19f559c Compare June 16, 2017 08:10
@thegcat thegcat force-pushed the feature/91-threshold_warnings branch from 19f559c to 50ab4a8 Compare June 16, 2017 08:43
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.

None yet

2 participants