008545bca8
Safari fails XHR requests which redirect to other domain (some old CORS bug they didn't fix for 5 years now)
33 lines
756 B
Ruby
33 lines
756 B
Ruby
require 'rails_helper'
|
|
|
|
describe AsciicastSerializer do
|
|
|
|
let(:serializer) { AsciicastSerializer.new(asciicast, playback_options: PlaybackOptions.new) }
|
|
let(:asciicast) { create(:asciicast) }
|
|
|
|
describe '#to_json' do
|
|
subject { JSON.parse(serializer.to_json) }
|
|
|
|
it 'includes id' do
|
|
expect(subject['id']).to eq(asciicast.to_param)
|
|
end
|
|
|
|
it 'includes url' do
|
|
expect(subject['url']).to eq(asciicast.file_url)
|
|
end
|
|
|
|
it 'includes snapshot' do
|
|
expect(subject['snapshot']).to eq(asciicast.snapshot)
|
|
end
|
|
|
|
it 'includes width' do
|
|
expect(subject['width']).to eq(asciicast.terminal_columns)
|
|
end
|
|
|
|
it 'includes height' do
|
|
expect(subject['height']).to eq(asciicast.terminal_lines)
|
|
end
|
|
end
|
|
|
|
end
|