diff --git a/spec/polyamorous/join_association_spec.rb b/spec/polyamorous/join_association_spec.rb index 8766f02..b07db29 100644 --- a/spec/polyamorous/join_association_spec.rb +++ b/spec/polyamorous/join_association_spec.rb @@ -10,6 +10,13 @@ module Polyamorous new_join_association(reflection, parent.children, Article) } + subject { new_join_association(reflection, parent.children, Person) } + + it 'respects polymorphism on equality test' do + expect(subject).to eq new_join_association(reflection, parent.children, Person) + expect(subject).not_to eq new_join_association(reflection, parent.children, Article) + end + it 'leaves the orginal reflection intact for thread safety' do reflection.instance_variable_set(:@klass, Article) join_association