Sha256: 9f025ef5c09002fc5d7decd7760bd365f95c9b29ae4e8bfe1760868906070071
Contents?: true
Size: 1.21 KB
Versions: 3
Compression:
Stored size: 1.21 KB
Contents
require_relative '../../../spec_helper' require_relative '../factories/meeting' describe Meeting do before(:all) do Meeting.delete_all end it "create meeting" do lambda { Factory(:meeting) }.should change(Meeting, :count).by(1) end context "Validation" do OVERLAP_TIME_RANGES.each do |description, time_range| it "is not valid if exists meeting which #{description}" do meeting = Factory.build(:meeting, :starts_at => time_range.first, :ends_at => time_range.last) meeting.should_not be_valid meeting.errors[:starts_at].should_not be_empty meeting.errors[:ends_at].should be_empty end end it " validate object which has not got overlap" do meeting = Factory.build(:meeting, :starts_at => "2011-01-09".to_date, :ends_at => "2011-01-11".to_date) meeting.should be_valid meeting.errors[:starts_at].should be_empty meeting.errors[:ends_at].should be_empty meeting = Factory.build(:meeting, :starts_at => "2011-01-01".to_date, :ends_at => "2011-01-02".to_date) meeting.should be_valid meeting.errors[:starts_at].should be_empty meeting.errors[:ends_at].should be_empty end end end
Version data entries
3 entries across 3 versions & 1 rubygems