Restore and update polyamorous join association equality spec, originally

6e2e1cc5d0 (diff-68f369577aaf68dd541acf26e438e413R20-R37)
This commit is contained in:
Piers Chambers 2020-04-01 18:06:50 -04:00
parent d054f114fd
commit ca51ed8a17
1 changed files with 7 additions and 0 deletions

View File

@ -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