mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Added validation in EventSchedule model and test in event_schedule_spec
EventSchedule start time should be in hours range of the conference.Therefore it adds validation on start_time attribute of event schedule model. It also adds test for the same.
This commit is contained in:
parent
be33f345a1
commit
95d459f058
6 changed files with 48 additions and 8 deletions
|
|
@ -23,7 +23,7 @@ describe Admin::EventSchedulesController do
|
|||
schedule_id: schedule.id,
|
||||
event_id: create(:event, program: conference.program).id,
|
||||
room_id: create(:room, venue: venue).id,
|
||||
start_time: conference.start_date)
|
||||
start_time: conference.start_date + conference.start_hour.hours)
|
||||
end
|
||||
|
||||
it 'saves the event schedule to the database' do
|
||||
|
|
@ -66,7 +66,7 @@ describe Admin::EventSchedulesController do
|
|||
schedule_id: schedule.id,
|
||||
event_id: create(:event, program: conference.program).id,
|
||||
room_id: room.id,
|
||||
start_time: conference.start_date)
|
||||
start_time: conference.start_date + conference.start_hour.hours)
|
||||
event_schedule.reload
|
||||
end
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ describe Admin::EventSchedulesController do
|
|||
end
|
||||
|
||||
it 'updates the start_time' do
|
||||
expect(event_schedule.start_time).to eq(conference.start_date)
|
||||
expect(event_schedule.start_time).to eq(conference.start_date + conference.start_hour.hours)
|
||||
end
|
||||
|
||||
it 'has 200 status code' do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue