Commit Graph

991 Commits

Author SHA1 Message Date
Gaetan Craig-Riou
83fa080f76 Fix product and inventory report 2024-07-03 10:17:49 +10:00
Gaetan Craig-Riou
17793e7b12 Fix packing report spec 2024-07-03 10:17:49 +10:00
Gaetan Craig-Riou
45f4365385 Fix order cycle management report 2024-07-03 10:17:49 +10:00
Gaetan Craig-Riou
c273c6b155 Fix enterprise fee with tax report specs 2024-07-03 10:17:49 +10:00
Gaetan Craig-Riou
40892580cd Fix enterprise fee summary report spec 2024-07-03 10:17:49 +10:00
Gaetan Craig-Riou
323602abbb Fix customer report specs 2024-07-03 10:17:49 +10:00
Gaetan Craig-Riou
fddfd0dbfb Fix bulk coop report 2024-07-03 10:17:49 +10:00
Gaetan Craig-Riou
c1dc87ae21 Fix enterprise fee calculator spec 2024-07-03 10:17:49 +10:00
Gaetan Craig-Riou
e48cdeba20 Fix product related permissions 2024-07-03 10:17:49 +10:00
Gaetan Craig-Riou
6d1a6c6d0e Fix orders and fulfillment reports
Plus specs
2024-07-03 10:17:49 +10:00
Gaetan Craig-Riou
71e4911b9e Fix order cycle permission 2024-07-03 10:17:49 +10:00
David Cook
d799230440 Update controller to catch more specific error
We now know which errors to expect. We still let other unknown errors raise higher up, where they will be logged with BugSnag, and treated as internal_server_error.
2024-06-27 12:51:28 +10:00
David Cook
92bd7a5d37 Revert new product duplicator behaviour 2024-06-27 11:39:49 +10:00
David Cook
898ab08bab Add specs for invalid records
It turns out that the duplicator still raises an exception in some cases. Now I think I see why the the controller was catching the exceptions. At least now we know which exceptions to catch.
2024-06-27 11:39:49 +10:00
Ahmed Ejaz
0aea201d53 11987: update mocking save! to save 2024-06-26 16:31:16 +05:00
Ahmed Ejaz
bb6e69ff56 Merge branch 'master' into task/12346-rubocop-rails-pluck-and-pluck-where 2024-06-25 11:53:50 +05:00
cyrillefr
659111932c Fixes Rails/RelativeDateConstant offense
- Cop: Rails/RelativeDateConstant
- raises offense if Constant is relative data (ie: since, ago)
- Reason: relative data will be evaluated only once
- BUT here, Date should not be evaluated in a class method, and have a different
- value for each call. But the data should be the same for an instance
- Therefore: move the ago in init method
- Cf. https://docs.rubocop.org/rubocop-rails/cops_rails.html#railsrelativedateconstant

- Since there is no constant to be called form a class, but a date from an instance, the
  spec has been modified accordingly. The RemoveTransientData.new.call had to be splitted.
2024-06-21 23:07:16 +02:00
Ahmed Ejaz
98e0b0e703 12346 - fix rubocop rails/pluck errors 2024-06-22 01:45:58 +05:00
Maikel
8837f1caa2 Revert "Allow negative stock levels for on-demand products" 2024-06-19 15:18:57 +10:00
Maikel Linke
ecbba894f7 Update stock levels of on-demand items
We weren't bothering with stock when items were on demand anyway. But we
want to track stock now so that we can backorder more when local stock
levels become negative.
2024-05-31 16:38:24 +10:00
Maikel Linke
ac24725d6c Move mail spec precompile assets for it
Specs in `spec/lib` don't trigger asset compilation but this particular
spec uses a mailer and needs assets.
2024-05-17 14:35:08 +10:00
Maikel Linke
6317fe1b71 Disable RSpec monkey patching 2024-05-09 12:24:41 +10:00
Maikel
a75f3245a0 Revert "Fix Duplicate Language Display on New User Creation" 2024-05-03 15:07:47 +10:00
Filipe
f269584b8e Merge pull request #12392 from sergioosouzaa/fix/duplicate-language-display-new-user-11513
Fix Duplicate Language Display on New User Creation
2024-04-25 16:01:09 +01:00
filipefurtad0
85e3d5d858 Tests payment intents for offline payments
Moves let variables outside shared examples block

Re-records cassettes
2024-04-23 12:24:00 +01:00
Sergio Souza
9477725997 update tests for avaliable_locales 2024-04-18 08:55:34 +10:00
Maikel Linke
5cd53e0b5e Clean up MailSettings spec
Best viewed with whitespace ignored.
2024-04-16 16:44:12 +10:00
Maikel Linke
a41019fbff Simplify SMTP auth method selection
Instead of using the auth method name, let's just not supply username
and password when we don't want to authenticate. The two affected
servers AU and CA don't have credentials set anyway. This is compatible.

The specs needed changing though.
2024-04-16 16:40:50 +10:00
Maikel Linke
d6f2a531aa Don't pass invalid auth method "None" to net-smtp
It's our magic word to not pass username and password on.
2024-04-16 16:18:49 +10:00
Maikel Linke
c0010319af Avoid duplicate loading of task in spec
The new product image import spec was loading rake tasks multiple times.
That make the spec for enterprise deletion fail when executed afterwards
because the deletion task was executed twice and failed the second time.
2024-04-09 12:04:42 +10:00
Ana Nunes da Silva
0726e4c1d0 Fix offense constant definition in block in reports/line_items_spec.rb 2024-04-08 11:16:38 +01:00
Ana Nunes da Silva
d726a0e3cb Fix offense constant definition in block in users.rake
This rake has tests
2024-04-08 11:16:38 +01:00
Ana Nunes da Silva
5415fa2db8 Fix offense constant definition in block in import_product_images_rake.rb
Add a test to import product images rake
2024-04-08 11:16:38 +01:00
cyrillefr
f57d44ba24 Fix Lint/DuplicateRequire issue
- updates the todo list
2024-04-05 17:09:14 +02:00
David Cook
af2e3ca703 Merge pull request #12326 from filipefurtad0/deletes_connected_accounts_after_specs
Removes Stripe accounts created for testing purposes
2024-04-03 10:37:17 +11:00
Matt-Yorkley
d9899e8af6 Update more specs 2024-04-02 09:27:36 +11:00
filipefurtad0
a3b646a500 Removes connected account
Re-records relevant VCR-cassettes for CreditCardCloner examples
2024-04-01 11:37:17 +01:00
filipefurtad0
01cbcf79fa Removes connected account
Re-records relevant VCR-cassettes for CreditCardRemover examples
2024-04-01 11:37:17 +01:00
Matt-Yorkley
c01bab5f27 Wrap commonly-repeated calls to Spree::Config to reduce unnecessary cache reads
These config values are relatively static but in some cases they can be called many times in the same request (like rendering a report or a large list of line_items in BOM). These values will now only get fetched from Redis/Postgres once at most per request/job.
2024-03-26 13:39:16 +00:00
Feruz Oripov
9d919938f3 Group Order && OrderCycle related services and specs 2024-03-16 19:07:08 +05:00
Gaetan Craig-Riou
ff52a66e75 Merge pull request #12250 from mkllnk/not-to-not
Enforce RSpec expect(..).not_to over to_not
2024-03-12 10:35:16 +11:00
Filipe
de9446f5f3 Merge pull request #12167 from mkllnk/haml-up
Update Haml syntax and gem to version 6
2024-03-07 15:36:29 +00:00
Maikel Linke
bd6b0ddbf3 Enforce RSpec expect(..).not_to over to_not 2024-03-07 16:57:54 +11:00
Feruz Oripov
1f299c84bc Merge branch 'master' into queries/naming 2024-03-02 16:32:50 +05:00
David Cook
7f77de89fc Explicitly load required file
This will be required if fixing FactoryBot/FactoryClassName
I'm not 100% sure about that rule yet, but figured this fix was worth keeping.
2024-02-28 09:37:34 +11:00
Feruz Oripov
c2d8bdd414 cops 2024-02-27 01:01:22 +05:00
Feruz Oripov
ff6830f954 Update OutstandingBalanceQuery 2024-02-26 23:37:11 +05:00
Feruz Oripov
81f40a99d9 Update CustomersWithBalanceQuery 2024-02-26 23:25:33 +05:00
David Cook
2107aeded1 Un-safely autocorrect RSpec/ExpectChange 2024-02-23 12:17:09 +11:00
David Cook
68cc9ed2fe Safely autocorrect Layout/EmptyLinesAroundBlockBody
Inspecting 1540 files
.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.............................................................................................................................................................................................................................................................................................................................................................C............................................................................

Offenses:

spec/lib/stripe/payment_intent_validator_spec.rb:7:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning.
spec/system/admin/products_v3/products_spec.rb:219:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.

1540 files inspected, 2 offenses detected, 2 offenses corrected
2024-02-23 10:02:23 +11:00