Consider nil in price expire time as effective

#522
This commit is contained in:
Artur Beljajev 2017-06-03 23:12:16 +03:00
parent 8916eee169
commit f76e1259fc
11 changed files with 106 additions and 65 deletions

View file

@ -1,20 +1,6 @@
require 'rails_helper'
RSpec.describe Billing::Price do
describe '::unexpired' do
before :example do
travel_to Time.zone.parse('05.07.2010 00:00')
create(:price, id: 1, expire_time: Time.zone.parse('04.07.2010 23:59'))
create(:price, id: 2, expire_time: Time.zone.parse('05.07.2010 00:00'))
create(:price, id: 3, expire_time: Time.zone.parse('05.07.2010 00:01'))
end
it 'returns prices with expire time in the future ' do
expect(described_class.unexpired.ids).to eq([2, 3])
end
end
describe '::expired' do
before :example do
travel_to Time.zone.parse('05.07.2010 00:00')