Commit Graph

377 Commits

Author SHA1 Message Date
Maikel Linke
d218a51d96 Test public instead of private method
Refactoring and styling the whole thing, possibly causing conflicts with
other pull requests.
2018-05-18 11:27:48 +10:00
Maikel Linke
57dd984512 Convert specs to RSpec 3.7.0 syntax with Transpec
This conversion is done by Transpec 3.3.0 with the following command:
    transpec spec/lib/open_food_network/order_and_distributor_report_spec.rb

* 2 conversions
    from: == expected
      to: eq(expected)

* 2 conversions
    from: obj.should
      to: expect(obj).to

For more details: https://github.com/yujinakayama/transpec#supported-conversions
2018-05-18 11:27:48 +10:00
Maikel Linke
8e2aee71da Compile Order Cycle Management only on search 2018-05-18 11:27:48 +10:00
Maikel Linke
7a546087b2 Compile Packing report data only on search 2018-05-18 11:27:47 +10:00
Maikel Linke
1e80487afc Compile Order And Distributors only on search
And move most logic into the report class like the others.
2018-05-18 11:27:47 +10:00
Maikel Linke
53436024e2 Compile Orders & Fulfillment report only on search 2018-05-18 11:27:47 +10:00
Maikel Linke
bf74282e5f Compile Bulk Co-Op report only on search 2018-05-18 11:27:47 +10:00
Maikel Linke
5f9d239f19 Compile Products & Inventory report only on search 2018-05-18 11:27:47 +10:00
Maikel Linke
d464216027 Don't compile Sales Tax report data before search 2018-05-18 11:27:47 +10:00
Maikel Linke
b8ca37e9d2 Don't compile xero report data before search 2018-05-18 11:27:47 +10:00
Maikel Linke
14e7cdd138 Don't compile customers report data before search
Distributors, suppliers and order cycles are still loaded for the search
form.
2018-05-18 11:27:47 +10:00
Maikel Linke
8393b1d4c0 Don't compile user-enterprises report before search 2018-05-18 11:27:47 +10:00
Daniel Dominguez
9d9a974295 Switched gem FactoryGirl to FactoryBot as FactoryGirl is deprecated.
- Change FactoryGirl to FactoryBot everywhere on code.
2018-05-04 11:52:08 -03:00
Maikel Linke
db61a2bb17 Parse available language string more relaxed
Splitting the string with any whitespace makes it more likely the code
knows what the human meant. It also makes `strip` obsolete, since there
can't be any whitespace within the splitted strings.
2018-03-09 19:41:49 +11:00
Maikel Linke
7a34c6e3f0 Introduce I18nConfig as single point of truth
It will be used in application.rb and views.
See https://github.com/openfoodfoundation/openfoodnetwork/issues/2113
2018-03-09 17:45:03 +11:00
Rob Harrington
09b800672d Fix specs to handle non-deterministic ordering 2018-02-09 14:44:15 +11:00
Rob Harrington
b7876ebfbf Replace references to 'standing order' with 'subscription' (spec) 2018-02-09 14:44:14 +11:00
Rob Harrington
902802594f Renaming standing order files (lib, spec) 2018-02-09 14:44:13 +11:00
Rob Harrington
e7eb02dfe3 Reduce cognitive complexity of VariantsController#search 2018-02-09 14:44:12 +11:00
Rob Harrington
ceab1fe16a Reduce cognitive complexity of StandingOrderPaymentUpdater 2018-02-09 14:44:11 +11:00
Rob Harrington
8ba1a909ca Use summarizer for standing order confirm job 2018-02-09 14:44:08 +11:00
Rob Harrington
b49c44f7ce Generalise record_failure method to record_and_log_error 2018-02-09 14:44:08 +11:00
Rob Harrington
13d01df4d8 Add mail method and template for sending placement summary emails to shop owners 2018-02-09 14:44:08 +11:00
Rob Harrington
cf30b7c883 Add service objects for summarizing outcomes of standing order processing jobs 2018-02-09 14:44:08 +11:00
Rob Harrington
03f1980b1b Auto-correct rubocop offences for standing-orders 2018-02-09 14:44:07 +11:00
Rob Harrington
26a325e6e0 Handle payment processing errors for standing orders 2018-02-09 14:44:07 +11:00
Rob Harrington
2576d10e49 Create a new payment when none is present 2018-02-09 14:44:07 +11:00
Rob Harrington
146348a4fe Refactor proxy order syncer using direct sql query for increased speed 2018-02-09 14:44:06 +11:00
Rob Harrington
3aee0b5e70 Allow proxy order syncer to accept both ActiveRecord::Relation or StandingOrder 2018-02-09 14:44:06 +11:00
Rob Harrington
6d5c920a95 Split proxy order sync logic out into dedicated service object 2018-02-09 14:44:06 +11:00
Rob Harrington
dfe874cf3f Attempt to add a credit card before processing payment 2018-02-09 14:44:04 +11:00
Rob Harrington
f4f6fb6a7a Update and process standing order payments prior to confirmation 2018-02-09 14:44:04 +11:00
Rob Harrington
c5066bb613 Making AddressFinder a little more secure
Only allow search by email when a customer or user with matching email is also provided
2018-02-09 14:43:59 +11:00
Rob Harrington
4a0dab3608 Renaming LastUsedAddress as AddressFinder 2018-02-09 14:43:59 +11:00
Rob Harrington
1b72b7258d Refactoring LastUsedAddress to take customers or users 2018-02-09 14:43:58 +11:00
Rob Harrington
6ea4aac361 WIP: Refactoring StandingOrderUpdater into StandingOrderForm
Update logic coupled to update action on controller rather than changes to the model
2018-02-09 14:43:38 +11:00
Rob Harrington
0b35cb6619 Standing Order Updater handles changes to line item quantities 2018-02-09 14:43:38 +11:00
Rob Harrington
9468dcb406 Adding lib class to maintain standing order orders 2018-02-09 14:43:38 +11:00
Rob Harrington
c18c1c67d1 Adding visibility permissions for standing orders 2018-02-09 14:43:32 +11:00
Matt-Yorkley
22eae753fe Remove enterprise confirmations 2018-02-07 10:41:52 +11:00
Pau Perez
6cb038c362 Autocorrect rubocop Layout/BlockEndNewline cop 2018-02-01 09:52:53 +01:00
Enrico Stano
114ce3b764 Merge pull request #1940 from coopdevs/improve-readability-shop
Improve readability of shop's code
2017-12-20 16:28:53 +11:00
Pierre de Lacroix
f67a8c1f2d Add tests 2017-12-01 13:37:24 +11:00
Rob Harrington
6c38997010 Fix 1664: product tag rules not working
Caused by a combination of: fe7bd5e2cd and 38d3b446cc

Have added/tweaked specs to prevent this from happening again
2017-11-15 10:26:24 +11:00
Rob Harrington
59578a73af Changing all references to 'be_true' and 'be_false' to 'be true' and 'be false'
See next commit for changes where this substitution was broken
2017-11-10 08:47:12 +11:00
Pau Perez
84e4ebef08 Do not notify Bugsnag of a cache miss
It's not the responsibility of a error tracking software to track
neither cache misses nor logs. That is what log monitoring is for.
2017-11-09 10:22:31 +01:00
Pau Perez
98603c4042 Do not test private methods 2017-11-09 10:22:31 +01:00
Pau Perez
26a4ee0171 Do not stub object under test 2017-11-09 10:22:31 +01:00
Pau Perez
4f03a2d25c Remove unnecessary require 2017-11-09 10:22:31 +01:00
Rob Harrington
01f9fd3232 Rename webhook handler status mappings 2017-10-12 22:47:51 +11:00