Skip to content

Commit

Permalink
add a spec
Browse files Browse the repository at this point in the history
  • Loading branch information
kratob committed Jan 17, 2025
1 parent 8b4119c commit fe1fc7c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/integration/has_many_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'spec_helper'

class HasManySpec
class AObject < ActiveType::Object
attribute :id, :string
attribute :a_name, :string
has_many :b_objects, class_name: "BObject"
end

class BObject < ActiveType::Object
attribute :b_name, :string
end
end

describe HasManySpec::AObject do
it 'does not crash' do
expect(HasManySpec::AObject.new(id: 'test_a', b_objects: [HasManySpec::BObject.new(b_name: 'test_b')]).id).to eq('test_a')
end
end

0 comments on commit fe1fc7c

Please sign in to comment.