|
| 1 | +require 'spec_helper' |
| 2 | +require 'json' |
| 3 | + |
| 4 | +RSpec.describe 'Dynamic Instrumentation' do |
| 5 | + include_context 'integration test' |
| 6 | + |
| 7 | + describe 'ActiveRecord integration' do |
| 8 | + subject { JSON.parse(get('di/ar_serializer').body) } |
| 9 | + |
| 10 | + it 'is loaded' do |
| 11 | + # If AR integration is loaded, this output will be the result of |
| 12 | + # the custom serializer. |
| 13 | + # If AR integration is not loaded, the output here will have a bunch of |
| 14 | + # internal AR fields but not the attributes themselves. |
| 15 | + expect(subject).to match( |
| 16 | + {"type"=>"Test", |
| 17 | + "entries"=> |
| 18 | + [[{"type"=>"Symbol", "value"=>"attributes"}, |
| 19 | + {"type"=>"Hash", |
| 20 | + "entries"=> |
| 21 | + [[{"type"=>"String", "value"=>"id"}, {"type"=>"Integer", "value"=>String}], |
| 22 | + [{"type"=>"String", "value"=>"version"}, {"type"=>"NilClass", "isNull"=>true}], |
| 23 | + [{"type"=>"String", "value"=>"data"}, {"type"=>"NilClass", "isNull"=>true}], |
| 24 | + [{"type"=>"String", "value"=>"created_at"}, |
| 25 | + {"type"=>"ActiveSupport::TimeWithZone", "value"=>String}], |
| 26 | + [{"type"=>"String", "value"=>"updated_at"}, |
| 27 | + {"type"=>"ActiveSupport::TimeWithZone", "value"=>String}]]}], |
| 28 | + [{"type"=>"Symbol", "value"=>"new_record"}, {"type"=>"FalseClass", "value"=>"false"}]]} |
| 29 | + ) |
| 30 | + end |
| 31 | + end |
| 32 | +end |
0 commit comments