Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Raise error for invalid transactions and add specs #22

Merged
merged 3 commits into from
Sep 14, 2016

Conversation

luukveenis
Copy link
Contributor

  • Adds specs for the transactions controller.
  • Raise error instead when validations fail
  • Display validation error messages instead of showing the error object's to_s

@luukveenis luukveenis force-pushed the transaction-controller-spec branch 3 times, most recently from fe3de32 to 15ded52 Compare September 14, 2016 17:14
# Creating the order also creates 3 addresses, we want to make sure
# the transaction import only creates 1 new one
order
expect { post_create }.to change { Spree::Address.count }.from(3).to(4)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer .by(1) rather than from(3).to(4)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went back and forth on that a couple times, will change back 👍

Luuk Veenis added 3 commits September 14, 2016 14:27
Instead of displaying the errors object's to_s, show the actual
validation errors.
@luukveenis luukveenis force-pushed the transaction-controller-spec branch from 15ded52 to bb377c7 Compare September 14, 2016 21:28
Copy link
Contributor

@stewart stewart left a comment

Choose a reason for hiding this comment

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

LGTM

@stewart stewart merged commit 0cb0652 into master Sep 14, 2016
@stewart stewart deleted the transaction-controller-spec branch September 14, 2016 21:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants