diff options
| author | Zog | 2018-01-24 10:15:48 +0100 | 
|---|---|---|
| committer | Zog | 2018-01-31 15:12:28 +0100 | 
| commit | b83d26389e6726eaea86955c3a2d2bffa5e65b5e (patch) | |
| tree | 73d1969dfca088b9d5bde998423c5773855fcb14 /spec | |
| parent | 52e07ba395ddd01f74eb6b81593dfdc7c636d25a (diff) | |
| download | chouette-core-b83d26389e6726eaea86955c3a2d2bffa5e65b5e.tar.bz2 | |
Refs #5682; Set default value for application days
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/models/calendar_spec.rb | 9 | 
1 files changed, 9 insertions, 0 deletions
| diff --git a/spec/models/calendar_spec.rb b/spec/models/calendar_spec.rb index 4c65b9660..86ce565cd 100644 --- a/spec/models/calendar_spec.rb +++ b/spec/models/calendar_spec.rb @@ -21,6 +21,15 @@ RSpec.describe Calendar, :type => :model do      end    end +  describe 'application days' do +    let(:calendar) { create(:calendar) } +    it "should default to all days" do +      %w(monday tuesday wednesday thursday friday saturday sunday).each do |day| +        expect(calendar.send(day)).to be_truthy +      end +    end +  end +    describe 'validations' do      it 'validates that dates and date_ranges do not overlap' do        expect(build(:calendar, dates: [Date.today], date_ranges: [Date.today..Date.tomorrow])).to_not be_valid | 
