Allow to specify an order schedule for new orders.
This commit is contained in:
parent
6e990fed4c
commit
219eb71bc9
16 changed files with 204 additions and 8 deletions
|
|
@ -44,4 +44,21 @@ describe Order do
|
|||
|
||||
end
|
||||
|
||||
describe 'with a default end date' do
|
||||
let(:order) { create :order }
|
||||
before do
|
||||
FoodsoftConfig[:order_schedule] = {ends: {recurr: 'FREQ=WEEKLY;BYDAY=MO', time: '9:00'}}
|
||||
order.init_dates
|
||||
end
|
||||
|
||||
it 'to have a correct date' do
|
||||
expect(order.ends.to_date).to eq Date.today.next_week.at_beginning_of_week(:monday)
|
||||
end
|
||||
|
||||
it 'to have a correct time' do
|
||||
expect(order.ends.strftime('%H:%M')).to eq '09:00'
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue