From 5253b169da36a3de270f00038597b007035f09dd Mon Sep 17 00:00:00 2001 From: Zog Date: Wed, 24 Jan 2018 10:15:48 +0100 Subject: Refs #5682; Set default value for application days --- spec/models/calendar_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'spec/models') 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 -- cgit v1.2.3