Skip to content

Re-enable and fix a couple of try_void related specs#304

Merged
elia merged 4 commits into
mainfrom
elia+rainer/try-void
May 2, 2023
Merged

Re-enable and fix a couple of try_void related specs#304
elia merged 4 commits into
mainfrom
elia+rainer/try-void

Conversation

@elia

@elia elia commented Apr 28, 2023

Copy link
Copy Markdown
Member

Summary

The implementation was fine, just had to adjust the expectation and test setup.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@elia elia added this to the v5 milestone Apr 28, 2023
@rainerdema rainerdema force-pushed the elia+rainer/try-void branch from bdbefd3 to 79ea5d3 Compare April 28, 2023 11:33
elia and others added 4 commits April 28, 2023 13:34
Turned out reusability was pretty low.

Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
Canceling an order will try to access `spree_current_user` in order to
pass it to `Order#canceled_by`.

Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
Canceling an order with a captured payment leaves the payment as
complete and performs a refund.

Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
@rainerdema rainerdema force-pushed the elia+rainer/try-void branch from 79ea5d3 to 2979d7e Compare April 28, 2023 11:34
@codecov

codecov Bot commented Apr 28, 2023

Copy link
Copy Markdown

Codecov Report

Merging #304 (2979d7e) into main (deb292a) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #304   +/-   ##
=======================================
  Coverage   99.63%   99.63%           
=======================================
  Files          30       30           
  Lines         546      546           
=======================================
  Hits          544      544           
  Misses          2        2           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@elia elia marked this pull request as ready for review April 28, 2023 11:48
@rainerdema rainerdema assigned kennyadsl and unassigned kennyadsl Apr 28, 2023
@rainerdema rainerdema requested a review from kennyadsl April 28, 2023 12:13

@waiting-for-dev waiting-for-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! 🚀

I'd still leave the backend helpers extracted into methods, mainly for consistency and better readability, but I leave it to your call 🙂

@elia

elia commented May 2, 2023

Copy link
Copy Markdown
Member Author

@waiting-for-dev we initially tried that approach but eventually we rolled it back because there was little to no reuse, as the combinations of flash messages and payment statuses were always different. Maybe there's a case for using I18n here, but that also as its own downsides, and is usually better to use raw values rather than dynamic ones in tests to avoid the equivalent of circular definitions.

@elia elia merged commit 91eaa5f into main May 2, 2023
@elia elia deleted the elia+rainer/try-void branch May 2, 2023 11:19
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.

4 participants