Adapt serializer specs to the new format

This commit is contained in:
James Mason 2018-09-29 16:13:38 -07:00
parent ac3be77219
commit 4256cdc06b
5 changed files with 122 additions and 138 deletions

View file

@ -8,7 +8,6 @@ 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,
@ -19,7 +18,6 @@ describe EventSerializer, type: :serializer do
type: 'Example Event Type',
room: nil,
track: nil
}
}.to_json
expect(serializer.to_json).to eq expected_json
@ -40,7 +38,6 @@ 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,
@ -51,7 +48,6 @@ describe EventSerializer, type: :serializer do
type: 'Example Event Type',
room: room.guid,
track: track.guid
}
}.to_json
expect(serializer.to_json).to eq expected_json

View file

@ -7,11 +7,9 @@ describe RoomSerializer, type: :serializer do
it 'set guid, name and description' do
expected_json = {
room: {
guid: room.guid,
name: room.name,
description: ''
}
}.to_json
expect(serializer.to_json).to eq expected_json

View file

@ -8,11 +8,9 @@ describe SpeakerSerializer, type: :serializer do
context 'speaker does not have biography' do
it 'sets name and affiliation' do
expected_json = {
speaker: {
name: 'John Doe',
affiliation: 'JohnDoesInc',
biography: nil
}
}.to_json
expect(serializer.to_json).to eq expected_json
@ -24,11 +22,9 @@ describe SpeakerSerializer, type: :serializer do
it 'sets name, affiliation and biography' do
expected_json = {
speaker: {
name: 'John Doe',
affiliation: 'JohnDoesInc',
biography: 'Doest of all Jon Does'
}
}.to_json
expect(serializer.to_json).to eq expected_json

View file

@ -8,11 +8,9 @@ describe TrackSerializer, type: :serializer do
it 'sets guild, name, color' do
expected_json = {
track: {
guid: track.guid,
name: track.name,
color: track.color
}
}.to_json
expect(serializer.to_json).to eq expected_json

View file

@ -1,7 +1,4 @@
{
"type": "object",
"required": ["conference"],
"properties": {
"conference" : {
"type" : "object",
"required" : [
@ -97,5 +94,4 @@
}
}
}
}
}