mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Add test of EventScheduleSerializer
This commit is contained in:
parent
9d98b30698
commit
b60257ef59
1 changed files with 21 additions and 0 deletions
21
spec/serializers/event_schedule_serializer_spec.rb
Normal file
21
spec/serializers/event_schedule_serializer_spec.rb
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe EventScheduleSerializer, type: :serializer do
|
||||||
|
let(:start) { DateTime.new(2000, 1, 2, 3, 4, 5) }
|
||||||
|
let(:conference) { create(:conference, start_date: start.to_date, start_hour: start.hour) }
|
||||||
|
let(:program) { create(:program, conference: conference) }
|
||||||
|
let(:event) { create(:event, program: program) }
|
||||||
|
let(:event_schedule) { create(:event_schedule, event: event, start_time: start) }
|
||||||
|
let(:serializer) { described_class.new(event_schedule) }
|
||||||
|
|
||||||
|
it 'sets date and room' do
|
||||||
|
expected_json = {
|
||||||
|
date: ' 2000-01-02T03:04:05+0000 ',
|
||||||
|
room: event_schedule.room.guid
|
||||||
|
}.to_json
|
||||||
|
|
||||||
|
expect(serializer.to_json).to eq expected_json
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue