Adapt serializer specs to the new format
This commit is contained in:
parent
ac3be77219
commit
4256cdc06b
5 changed files with 122 additions and 138 deletions
|
|
@ -8,18 +8,16 @@ describe EventSerializer, type: :serializer do
|
|||
context 'event does not have date, room and tracks assigned' do
|
||||
it 'sets guid, title, length, abstract and type' do
|
||||
expected_json = {
|
||||
event: {
|
||||
guid: event.guid,
|
||||
title: 'Some Talk',
|
||||
length: 30,
|
||||
scheduled_date: '',
|
||||
language: nil,
|
||||
abstract: 'Lorem ipsum dolor sit amet',
|
||||
speaker_ids: event.speaker_ids,
|
||||
type: 'Example Event Type',
|
||||
room: nil,
|
||||
track: nil
|
||||
}
|
||||
guid: event.guid,
|
||||
title: 'Some Talk',
|
||||
length: 30,
|
||||
scheduled_date: '',
|
||||
language: nil,
|
||||
abstract: 'Lorem ipsum dolor sit amet',
|
||||
speaker_ids: event.speaker_ids,
|
||||
type: 'Example Event Type',
|
||||
room: nil,
|
||||
track: nil
|
||||
}.to_json
|
||||
|
||||
expect(serializer.to_json).to eq expected_json
|
||||
|
|
@ -40,18 +38,16 @@ describe EventSerializer, type: :serializer do
|
|||
|
||||
it 'sets guid, title, length, abstract, type, date, language, speakers, room and track' do
|
||||
expected_json = {
|
||||
event: {
|
||||
guid: event.guid,
|
||||
title: 'Some Talk',
|
||||
length: 30,
|
||||
scheduled_date: ' 2014-03-04T09:00:00+0000 ',
|
||||
language: 'English',
|
||||
abstract: 'Lorem ipsum dolor sit amet',
|
||||
speaker_ids: [speaker.id],
|
||||
type: 'Example Event Type',
|
||||
room: room.guid,
|
||||
track: track.guid
|
||||
}
|
||||
guid: event.guid,
|
||||
title: 'Some Talk',
|
||||
length: 30,
|
||||
scheduled_date: ' 2014-03-04T09:00:00+0000 ',
|
||||
language: 'English',
|
||||
abstract: 'Lorem ipsum dolor sit amet',
|
||||
speaker_ids: [speaker.id],
|
||||
type: 'Example Event Type',
|
||||
room: room.guid,
|
||||
track: track.guid
|
||||
}.to_json
|
||||
|
||||
expect(serializer.to_json).to eq expected_json
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue