David Cook
a94c50f0c1
Count updated products
...
Ignoring variants for now.
2023-11-03 14:32:58 +11:00
David Cook
de915e8bd7
Capture variant errors when updating
2023-11-03 14:32:55 +11:00
David Cook
1d5ec6b8d2
Spec for updating products with variants
...
Trying to cover it more comprehensively, and revealing we have a lot of behaviour to update.
Products and their variants should always get saved (or not saved) together. This is considered the most intuitive behaviour.
There's still duplication with the "variant has error" context, but I try to avoid nesting shared_examples, it starts to get ugly. Happy to discuss though.
2023-11-02 15:42:40 +11:00
David Cook
e651e3cd5e
Tiny spec refactor
...
I found this in my stashes
2023-11-02 11:05:45 +11:00
David Cook
39eeb0e917
Add spec for truthiness
...
It's generally expected that a #save method will return true on succes, and false on failure.
2023-11-02 11:05:45 +11:00
Maikel
25a3149f48
Merge pull request #11702 from dacook/buu-editing-part5b-11059
...
[BUU] Mark changed fields, when error
2023-11-01 13:01:08 +11:00
David Cook
89e53c88f3
Move context up a level
...
Best viewed with whitespace ignored.
2023-10-24 15:21:13 +11:00
David Cook
8293f24ed3
Remove redundant context
...
Best viewed with whitespace ignored.
2023-10-24 15:21:13 +11:00
David Cook
224b6f514b
Remove concept of master variant
...
from old bulk product screen. Hmm I just realised we're deleting that screen soon anyway.
But this helps clean up the spec before I refactor it further.
2023-10-24 15:21:13 +11:00
David Cook
be6481dac3
Refactor spec: combine expectations
...
These expectations have the same conditions, so why set it up three times?
2023-10-24 15:21:13 +11:00
David Cook
3710aa2149
Refactor spec
...
Better to explicitly test for the change, and specify expected values.
2023-10-24 15:21:13 +11:00
Neal Chambers
dc607b654d
Fix Style/HashSyntax
2023-10-24 08:49:34 +09:00
filipefurtad0
c05716cea9
Addresses review suggestions from @dacook
...
I've noticed that it was necessary to include a reference to the order like 'order.adjustments << create(:adjustment, order:)' for the tests to pass
Updates test case description
2023-10-19 15:49:28 +01:00
filipefurtad0
2004abc8be
Sets pending test - issue #11350
...
changing the payment_total should not generate a new invoice; rather, it should update the current invoice
2023-10-18 11:20:48 +01:00
filipefurtad0
530cdacc77
Restructures tests as shared examples
...
Merges test files
2023-10-18 11:20:06 +01:00
filipefurtad0
8a1a14112b
Moves tests to shared examples file
2023-10-18 11:20:05 +01:00
filipefurtad0
8b249ee050
Adds unit tests for different attributes
2023-10-18 11:19:03 +01:00
Maikel
b122c93055
Merge pull request #11586 from macanudo527/fix_stylehash_11
...
Fix Style/HashSyntax 12/13
2023-10-02 16:25:21 +11:00
Konrad
06ebeeac0f
Merge pull request #11543 from rioug/11364-Voucher-fix-tax-report
...
[Vouchers] Fix Sales Tax Totals By Order report
2023-10-01 02:09:33 +02:00
Neal Chambers
57d2f04330
Fix Style/HashSyntax
2023-09-29 08:51:48 +09:00
Gaetan Craig-Riou
b129b9f1d0
DRY up specs
2023-09-26 10:50:58 +02:00
Neal Chambers
70e218d2e9
Fix Style/HashSyntax
2023-09-25 13:15:38 +09:00
Gaetan Craig-Riou
03ce39d5c5
Add metadata to tax related voucher adjustment
...
In the scenario where you have tax excluded from price, when adding
a voucher to an order, we create 2 voucher adjusments. One of them
represent the tax part of the voucher, and has a label starting with
"Tax". To better differentiate them and allow a reliable way to
query it, we add a metadata entry.
2023-09-22 11:16:21 +02:00
Gaetan Craig-Riou
7c34145ed7
Add voucher_included_tax and voucher_excluded_tax
...
It retrieves the tax part of the voucher adjustment for tax included
in price and tax excluded from price respectively.
2023-09-22 10:17:40 +02:00
Maikel Linke
ee1611904b
Fix typos in spec description
2023-09-21 16:37:07 +10:00
Maikel
1991970185
Merge pull request #11377 from mkllnk/dfc-update-request
...
[DFC API] Import known units when creating new products
2023-09-08 09:05:26 +10:00
Konrad
3b9ebf4e07
Merge pull request #11396 from abdellani/fix-if-tos-is-not-set
...
fix If ToS file is not set, customer needs to accept Terms on each checkout
2023-09-06 16:56:21 +02:00
David Cook
0874c7ddb8
Merge pull request #11309 from filipefurtad0/legal_invoices_spec_comparator
...
[Invoices] Adds unit level test coverage order model attributes
2023-09-05 09:45:00 +10:00
filipefurtad0
82ca115931
Removes unnecessary && operator
...
reloads instead of saving order again
2023-09-04 19:35:28 +01:00
filipefurtad0
4e54279b05
Rearranges relevant and non-relevant test cases
2023-09-04 19:32:06 +01:00
David Cook
32c0b5a3e2
Remove unnecessary details
...
As far as I can tell we didn't need to specify these for the tests.
2023-09-01 12:04:27 +10:00
David Cook
381ce1c2b9
Simplify order definition
...
There only needs to be one order at a time, and it can be created on-demand. We can simply override it in the specs that need to.
2023-09-01 12:00:29 +10:00
Neal Chambers
afdddc9237
Safely autocorrect Style/FileRead
...
Inspecting 1488 files
.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C............................................................................................................................................................................
Offenses:
lib/tasks/karma.rake:33:15: C: [Corrected] Style/FileRead: Use File.read.
unit_js = File.open('config/ng-test.conf.js', 'r').read
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/services/upload_sanitizer_spec.rb:13:41: C: [Corrected] Style/FileRead: Use File.read.
let(:service) { UploadSanitizer.new(File.open(upload).read) }
^^^^^^^^^^^^^^^^^^^^^^
1488 files inspected, 2 offenses detected, 2 offenses corrected
2023-09-01 08:55:56 +09:00
filipefurtad0
e0031225d1
Covers order special instruction
2023-08-31 14:25:18 +01:00
filipefurtad0
3374c38d5c
Covers order state - cancelled, resumed - changes
2023-08-31 14:25:18 +01:00
filipefurtad0
301c070fc3
Covers order currency change
2023-08-31 14:25:18 +01:00
filipefurtad0
2e72fe1bce
Covers order number change
2023-08-31 14:25:18 +01:00
filipefurtad0
38eb84b1d8
Covers order total change
2023-08-31 14:25:18 +01:00
filipefurtad0
b0c362f75e
Corrects description, if the order didn't change
2023-08-31 14:25:18 +01:00
filipefurtad0
79a38345e9
Passes order as argument
...
to invoice comparator
2023-08-31 14:25:18 +01:00
filipefurtad0
a223675e74
Covers shipping method change
2023-08-31 14:25:18 +01:00
filipefurtad0
0540548893
Adds coverage for included/added taxes
...
at the order-object level
2023-08-31 14:25:18 +01:00
filipefurtad0
8d382f3de4
Corrects description
...
for order-level, non-relevant attribute change
2023-08-31 14:25:18 +01:00
Maikel Linke
50f7177a38
Use existing service to label weight&volume units
...
We still have the scale stored in two places but in our current system
that's part of a unit's "id".
If the DFC adds that value to its standard then we can use it for lookup
and don't need to repeat it.
* https://github.com/datafoodconsortium/taxonomies/issues/7
2023-08-31 09:48:24 +10:00
Filipe
cc3b7c68ae
Merge pull request #11208 from dacook/buu-editing-11059
...
[BUU] Change name of my products 🚧
2023-08-24 21:19:52 +01:00
Filipe
10bc2a3ee6
Merge pull request #11430 from abdellani/fix-updating-invoices-data
...
fix order invoice generator must update the latest invoice
2023-08-24 20:58:37 +01:00
Mohamed ABDELLANI
d47b47627c
tos_accepted? returns true if the ToS file is not set
2023-08-22 10:22:26 +01:00
David Cook
ef63c520c0
Aggregate errors
2023-08-22 11:40:58 +10:00
David Cook
a0dba001bc
Attempt to save all records in bulk update
...
Before, it would abort after the first invalid record, and it doesn't tell you about the others. This way you find out about all at once.
This affects the existing Bulk Edit Products screen, and can result in longer error messages than before. But I would argue that's a good thing.
I think this is technically optional for BUU at this point, but a helpful improvement.
2023-08-22 11:40:58 +10:00
David Cook
6ffe1ec1ad
Retain the order of products in the collection
2023-08-22 11:40:58 +10:00