debian-mirror-gitlab/spec/models/concerns/blocks_json_serialization_spec.rb

23 lines
527 B
Ruby
Raw Normal View History

2019-07-07 11:18:12 +05:30
# frozen_string_literal: true
2019-12-04 20:38:33 +05:30
require 'spec_helper'
2018-03-17 18:26:18 +05:30
2020-07-28 23:09:34 +05:30
RSpec.describe BlocksJsonSerialization do
2020-05-24 23:13:21 +05:30
before do
stub_const('DummyModel', Class.new)
DummyModel.class_eval do
include BlocksJsonSerialization
end
2018-03-17 18:26:18 +05:30
end
it 'blocks as_json' do
expect { DummyModel.new.as_json }
.to raise_error(described_class::JsonSerializationError, /DummyModel/)
end
it 'blocks to_json' do
expect { DummyModel.new.to_json }
.to raise_error(described_class::JsonSerializationError, /DummyModel/)
end
end