diff options
| author | Robert | 2017-06-27 14:25:35 +0200 | 
|---|---|---|
| committer | Robert | 2017-06-27 14:25:35 +0200 | 
| commit | f20df3c08dfec0e3dda68401204f7d49470119a7 (patch) | |
| tree | 4f27a34130d4ff044d48729f16d2dff154047ce5 /spec/models/calendar_spec.rb | |
| parent | 970954938043d8d73c4457ee2d91e22c0e422e65 (diff) | |
| parent | eabd56ff9f2c7979192e54b4ae11673f1cc778c1 (diff) | |
| download | chouette-core-f20df3c08dfec0e3dda68401204f7d49470119a7.tar.bz2 | |
conflicts resolved
Diffstat (limited to 'spec/models/calendar_spec.rb')
| -rw-r--r-- | spec/models/calendar_spec.rb | 10 | 
1 files changed, 3 insertions, 7 deletions
| diff --git a/spec/models/calendar_spec.rb b/spec/models/calendar_spec.rb index 6a2b24011..a3da95aca 100644 --- a/spec/models/calendar_spec.rb +++ b/spec/models/calendar_spec.rb @@ -109,15 +109,11 @@ RSpec.describe Calendar, :type => :model do      let(:calendar) { create(:calendar, date_ranges: []) }      it 'shoud fill date_ranges with date ranges' do -      expected_ranges = [ -        Range.new(Date.today, Date.tomorrow) -      ] -      expected_ranges.each_with_index do |range, index| -        calendar.date_ranges << Calendar::Period.from_range(index, range) -      end +      expected_range = Date.today..Date.tomorrow +      calendar.date_ranges << expected_range        calendar.valid? -      expect(calendar.date_ranges.map { |period| period.begin..period.end }).to eq(expected_ranges) +      expect(calendar.date_ranges.map { |period| period.begin..period.end }).to eq([expected_range])      end    end | 
