2019-04-29 20:27:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-10-04 10:00:07 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe UploadSerializer do
|
2019-05-06 23:12:20 -04:00
|
|
|
fab!(:upload) { Fabricate(:upload) }
|
2018-10-04 10:00:07 -04:00
|
|
|
let(:subject) { UploadSerializer.new(upload, root: false) }
|
|
|
|
|
|
|
|
it 'should render without errors' do
|
|
|
|
json_data = JSON.load(subject.to_json)
|
|
|
|
|
|
|
|
expect(json_data['id']).to eql upload.id
|
|
|
|
expect(json_data['width']).to eql upload.width
|
|
|
|
expect(json_data['height']).to eql upload.height
|
|
|
|
expect(json_data['thumbnail_width']).to eql upload.thumbnail_width
|
|
|
|
expect(json_data['thumbnail_height']).to eql upload.thumbnail_height
|
|
|
|
end
|
|
|
|
end
|