2019-03-30 03:23:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-18 23:18:51 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe BlocksJsonSerialization do
|
|
|
|
DummyModel = Class.new do
|
|
|
|
include BlocksJsonSerialization
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'blocks as_json' do
|
2017-12-19 16:44:54 -05:00
|
|
|
expect { DummyModel.new.as_json }
|
2017-12-01 12:33:02 -05:00
|
|
|
.to raise_error(described_class::JsonSerializationError, /DummyModel/)
|
2017-09-18 23:18:51 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'blocks to_json' do
|
|
|
|
expect { DummyModel.new.to_json }
|
2017-12-01 12:33:02 -05:00
|
|
|
.to raise_error(described_class::JsonSerializationError, /DummyModel/)
|
2017-09-18 23:18:51 -04:00
|
|
|
end
|
|
|
|
end
|