mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Add times to Conference
Add start hour and end hour to conference to be able to make the schedule times changeable
This commit is contained in:
parent
7000e63700
commit
b80aff3cce
5 changed files with 50 additions and 1 deletions
|
|
@ -1545,6 +1545,14 @@ describe Conference do
|
|||
should validate_presence_of(:end_date)
|
||||
end
|
||||
|
||||
it 'is not valid without a start date' do
|
||||
should validate_presence_of(:start_hour)
|
||||
end
|
||||
|
||||
it 'is not valid without an end date' do
|
||||
should validate_presence_of(:end_hour)
|
||||
end
|
||||
|
||||
it 'is not valid with a duplicate short title' do
|
||||
should validate_uniqueness_of(:short_title)
|
||||
end
|
||||
|
|
@ -1572,6 +1580,21 @@ describe Conference do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'valid_times_range?' do
|
||||
|
||||
it 'is not valid if start hour is lower than 0' do
|
||||
expect(subject.start_hour).to be >= 0
|
||||
end
|
||||
|
||||
it 'is not valid if end hour is lower or equal than start hour' do
|
||||
expect(subject.start_hour).to be < subject.end_hour
|
||||
end
|
||||
|
||||
it 'is not valid if end hour is greater than 24' do
|
||||
expect(subject.end_hour).to be <= 24
|
||||
end
|
||||
end
|
||||
|
||||
describe 'before create callbacks' do
|
||||
|
||||
it 'has an email setting after creation' do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue