Merge branch 'master' of github.com:foodcoops/foodsoft into feature/tw_automatic_group_order_invoice_generation
This commit is contained in:
commit
d37a75262d
4 changed files with 19 additions and 1 deletions
|
|
@ -8,6 +8,20 @@ describe Ordergroup do
|
|||
let(:ftt3) { create :financial_transaction_type, financial_transaction_class: ftc2 }
|
||||
let(:user) { create :user, groups: [create(:ordergroup)] }
|
||||
|
||||
it 'shows no active ordergroups when all orders are older than 3 months' do
|
||||
order = create :order, starts: 4.months.ago
|
||||
user.ordergroup.group_orders.create!(order: order)
|
||||
|
||||
expect(Ordergroup.active).to be_empty
|
||||
end
|
||||
|
||||
it 'shows active ordergroups when there are recent orders' do
|
||||
order = create :order, starts: 2.days.ago
|
||||
user.ordergroup.group_orders.create!(order: order)
|
||||
|
||||
expect(Ordergroup.active).not_to be_empty
|
||||
end
|
||||
|
||||
context 'with financial transactions' do
|
||||
before do
|
||||
og = user.ordergroup
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue