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

Remove user prereq from First Order promorule #2928

Merged
merged 1 commit into from
Jan 31, 2019

Conversation

fastjames
Copy link
Contributor

When a customer applies a promotion with a "first order" rule, the rule
checks for a User or email associated with the order. This is not
strictly necessary, since the order can be checked after the coupon is
applied and if the user is found to have an existing order the coupon
gets removed then.

@fastjames
Copy link
Contributor Author

I can see a possible case for reintroducing the guard with a switch related to the config setting that requires login.

Copy link
Contributor

@aitbw aitbw left a comment

Choose a reason for hiding this comment

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

Hi @fastjames, could you please have a look at why the CI builds are failing?

I also left some comments you should address once your branch is rebased 🙌

Thanks for the PR!

frontend/spec/features/first_order_promotion_spec.rb Outdated Show resolved Hide resolved
frontend/spec/features/first_order_promotion_spec.rb Outdated Show resolved Hide resolved
@fastjames fastjames force-pushed the first_order_promo_prereq branch from a54c1a6 to 61c8b07 Compare December 3, 2018 17:08
@fastjames
Copy link
Contributor Author

@aitbw thanks for the feedback, I have made the requested changes and rebased against today's master.

@fastjames fastjames force-pushed the first_order_promo_prereq branch 2 times, most recently from e4cba8b to 764630f Compare December 3, 2018 18:33
Copy link
Contributor

@jacobherrington jacobherrington left a comment

Choose a reason for hiding this comment

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

I can see the reasoning behind this and the tests look good. Just one comment.

frontend/spec/features/first_order_promotion_spec.rb Outdated Show resolved Hide resolved
@fastjames fastjames force-pushed the first_order_promo_prereq branch from 764630f to c7fe5c9 Compare January 4, 2019 23:05
Copy link
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

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

@fastjames I left a comment for a small possible change, thank you for this PR 👏

end
end

def fill_in_address
Copy link
Member

Choose a reason for hiding this comment

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

I think that, by defining this method here, you're polluting the main namespace. I think that this method can be moved inside the Rspec.feature block or, since this method is used only once here, it could be removed and the code inlined directly where it's used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I don't want to be a polluter. I have moved it into the feature block.

@fastjames fastjames force-pushed the first_order_promo_prereq branch from c7fe5c9 to 1ab7f10 Compare January 25, 2019 17:50
fill_in "#{address}_phone", with: "(555) 555-5555"
end
end

Choose a reason for hiding this comment

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

Layout/TrailingBlankLines: 1 trailing blank lines detected.

@fastjames fastjames force-pushed the first_order_promo_prereq branch from 1ab7f10 to c11cddf Compare January 25, 2019 17:51
When a customer applies a promotion with a "first order" rule, the rule
checks for a User or email associated with the order. This is not
strictly necessary, since the order can be checked after the coupon is
applied and if the user is found to have an existing order the coupon
gets removed then.
@fastjames fastjames force-pushed the first_order_promo_prereq branch from c11cddf to 0e0b126 Compare January 25, 2019 21:34
Copy link
Contributor

@jacobherrington jacobherrington left a comment

Choose a reason for hiding this comment

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

I think this change makes sense! Thanks @fastjames 👍

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

👍 Thanks!

@kennyadsl kennyadsl merged commit 14a9eb1 into solidusio:master Jan 31, 2019
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.

6 participants