Luis Ramos
f848a89a00
Rename update_attributes to update #rails4
2020-06-22 16:51:43 +01:00
Luis Ramos
c9a7a6e897
Merge branch 'master' into 3-0-stable-jun-2
2020-06-02 16:00:45 +01:00
Luis Ramos
758d7c82f7
Rename order_cycle.accessible_by to remove name clash with active record
2020-05-19 12:21:13 +01:00
Luis Ramos
19da0ba969
Merge branch 'master' into 3-0-stable-may13
2020-05-13 19:50:32 +01:00
Matt-Yorkley
eb51b87bea
Add spec for current soft deletion behaviour in OrderCycle#variants_distributed_by scope
2020-05-05 13:57:50 +02:00
Luis Ramos
0e607003c1
Fix problem in order cycles spec where miliseconds were not matching
2020-02-28 11:06:16 +00:00
Matt-Yorkley
ab330e882e
Remove product cache
2019-10-18 21:15:11 +01:00
Maikel Linke
73372a58ef
Remove unused and dangerous Exchange#eql? override
...
The `eql?` override has been added in very early commits but was
actually not used except in a test. It also caused performance problems
since each call to `eql?` would issue two database queries. A developer
would unknowingly trigger these when using `exchanges.uniq`. A mistake
that could have happened again in the future.
I moved the implementation to the test that was actually using it and
made a second test a bit more explicit.
2019-07-02 18:42:02 +10:00
luisramos0
86b0d71c7e
Result of rubocop auto-correct and rebuilding rubocop_manual_todo
2019-05-28 12:57:29 +01:00
luisramos0
04801e5c2e
Run transpec in spec/models
2019-05-09 22:25:29 +01:00
luisramos0
60ee17204b
Merge branch 'master' into 2-0-stable-Mar16
2019-03-16 16:17:38 +00:00
Pau Pérez Fabregat
13b2115a29
Merge pull request #3581 from coopdevs/cache-stylistic-improvements
...
Cache stylistic improvements
2019-03-13 19:05:38 +01:00
Pau Perez
7c533c6347
Extract DistributedValidProducts from OrderCycle
2019-03-06 13:35:43 +01:00
luisramos0
351555d4e2
Remove unused methods from add_to_cart helper and distribution change validator
2019-03-02 12:55:08 +00:00
luisramos0
5b4c986733
Add spec to cover variant scoping in order_cycle.items_bought_by_user
2019-02-20 00:05:28 +00:00
luisramos0
fcdb5cd7af
Merge branch 'master' into 2-0-stable-nov-8th
2018-11-08 11:18:54 +00:00
luisramos0
4f992a18f7
Fix specs creating deleted variants
...
Spree checks that each price belongs to a variant
Since we were creating deleted variants, the price models couldnt see those
2018-11-05 10:43:10 +00:00
Maikel Linke
e6adb8a3b9
Extract email setup in specs for easy upgrade
...
The way we set up email sending completely changes with Spree 2. This
change encapsulates that code in a single method so that it can be
changed easily and doesn't create further merge conflicts while we are
still working on the master branch and the Spree upgrade.
2018-10-25 13:53:22 +11:00
luisramos0
082f9e404b
Fixed test on order_cycle_spec by replacing eq with match_array
2018-08-27 21:04:18 +01:00
luisramos0
b5038fa5dc
Changed calls to MailMethod in specs to calls to Spree::Config[:mails_from]
2018-08-27 21:02:54 +01:00
Rob Harrington
b17d8c2fe3
Add validation of open and close dates for order cycles
2018-04-04 17:18:32 +10:00
Pau Perez
6cb038c362
Autocorrect rubocop Layout/BlockEndNewline cop
2018-02-01 09:52:53 +01: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
Enrico Stano
7874d96003
Set MailMethod for test environment when needed
2017-09-08 23:55:50 +10:00
Rob Harrington
314ccc2f27
Ensuring that #items_bought_by_user doesn't return items from cancelled orders
2017-05-05 14:20:57 +10:00
Rohan Mitchell
422061f137
Merge branch 'master' into products-caching
...
Conflicts:
app/controllers/shop_controller.rb
app/models/enterprise_fee.rb
app/models/order_cycle.rb
app/models/variant_override.rb
db/schema.rb
lib/open_food_network/products_renderer.rb
spec/lib/open_food_network/products_renderer_spec.rb
2016-03-03 09:42:52 +11:00
Rob Harrington
f280b96215
Hiding a variant from inventory prevents it being available on the shopfront
...
User preferences around inventory-only product selection immediately affect the shopfront
2016-03-02 12:10:22 +11:00
Rob Harrington
77e74c5642
OC Coordinators can opt to restrict products in an order cycle to those in their inventory only
2016-03-02 12:10:22 +11:00
Rohan Mitchell
378a703cc3
Order cycles are undated unless they have both open and close dates defined
2016-02-24 15:05:02 +11:00
Rohan Mitchell
fe41430d1e
Rerefesh products cache when an order cycle is changed
2016-02-24 15:05:02 +11:00
Rohan Mitchell
5d20b4fb51
Add OrderCycle scopes: not_closed, dated
2016-02-24 15:05:01 +11:00
Rohan Mitchell
48b02db70d
Order cycles are undated unless they have both open and close dates defined
2016-02-05 09:27:25 +11:00
Continuous Integration
ae945ace9d
Auto-merge from CI [skip ci]
2015-12-11 11:09:54 +11:00
Maikel Linke
cd7721a127
Using date and time of current timezone
...
Using Time.zone.now and Date.current instead of Time.now and Date.today.
This should make all specs timezone independent.
2015-12-10 11:38:41 +11:00
Rohan Mitchell
ea6974d438
Add OrderCycle#supplied_variants
2015-12-10 09:17:25 +11:00
Rob Harrington
2483eef4be
WIP: BOM Refactor, removing obsolete OrderCycle.recently_closed scope, ordering closed OCs
2015-11-05 14:02:04 +11:00
Rohan Mitchell
be66769999
SELECT DISTINCT results in inconsistent #count value. Work around this with to_a.
2015-08-05 11:05:29 +10:00
Rohan Mitchell
22230294ab
Merge branch 'master' into optimise-shopfront
2015-06-03 10:07:42 +10:00
Rohan Mitchell
7486daa2a3
Merge branch 'master' into require_standard_variant
...
Conflicts:
spec/controllers/spree/admin/variants_controller_spec.rb
spec/lib/open_food_network/permissions_spec.rb
spec/lib/open_food_network/products_and_inventory_report_spec.rb
spec/models/enterprise_spec.rb
2015-05-28 15:08:13 +10:00
Rohan Mitchell
97e49c2bdb
Replace 'array.sort.should == expected.sort' pattern with match_array
2015-05-28 10:46:08 +10:00
Rohan Mitchell
769edbe9d5
Find the earliest closing times for each distributor in an active order cycle
2015-05-27 15:44:01 +10:00
Rob Harrington
b9f19d5777
Fixing broken specs
2015-04-17 13:00:20 +10:00
Victor Nava
d6c30ae1ef
OrderCycle#recently_closed doesn't return orders that are open
2015-03-05 17:28:24 +11:00
Victor Nava
1b709a3e03
Do not load Order Cycles that closed more than a month a go
2015-03-05 16:04:36 +11:00
Maikel Linke
8e280919ac
Using simple_order_cycle in clone spec
...
Creating a coordinator fee and two exchanges in the spec instead of
using a full order_cycle. Timing of this single test:
Before: 15.32 seconds
After: 6.26 seconds
2014-11-28 15:36:34 +11:00
Maikel Linke
aa2cefb88c
Using simple_order_cycle where applicable
...
Before: 3 minutes 0 seconds
After: 1 minute 21.02 seconds
2014-11-28 13:45:25 +11:00
Rafael Schouten
b821107c27
bugfix migration ad specs
2014-09-27 18:14:10 +10:00
Rohan Mitchell
66cece5903
WIP: Extract order cycle fee calculations to EnterpriseFeeCalculator
2014-07-31 11:36:53 +10:00
Will Marshall
0479a0a55d
Fixing bugs, improving dates
2014-04-23 15:46:14 +10:00
Rohan Mitchell
47ac097eb7
Do not show deleted variants on shopfront
2014-04-11 19:08:55 +10:00