diff options
| author | Zog | 2018-01-24 10:15:48 +0100 |
|---|---|---|
| committer | cedricnjanga | 2018-02-06 11:06:08 -0800 |
| commit | 5253b169da36a3de270f00038597b007035f09dd (patch) | |
| tree | a607f7779203fb5ed38f7829dda62cf437224ca3 /spec/models | |
| parent | b1fc1da5262d2b03c872829a7e1238059243e9f3 (diff) | |
| download | chouette-core-5253b169da36a3de270f00038597b007035f09dd.tar.bz2 | |
Refs #5682; Set default value for application days
Diffstat (limited to 'spec/models')
| -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 |
