add spec to check infinite loop

check hzamani/acts_as_relation#82