2018-05-07 16:47:29 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2016-04-02 20:58:16 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
describe RoomSerializer, type: :serializer do
|
|
|
|
|
let(:room) { create(:room) }
|
|
|
|
|
let(:serializer) { RoomSerializer.new(room) }
|
|
|
|
|
|
|
|
|
|
it 'set guid, name and description' do
|
|
|
|
|
expected_json = {
|
|
|
|
|
room: {
|
|
|
|
|
guid: room.guid,
|
2016-05-02 15:25:18 +02:00
|
|
|
name: room.name,
|
2016-04-02 20:58:16 +05:30
|
|
|
description: ''
|
|
|
|
|
}
|
|
|
|
|
}.to_json
|
|
|
|
|
|
|
|
|
|
expect(serializer.to_json).to eq expected_json
|
|
|
|
|
end
|
|
|
|
|
end
|