问题
我的通知模型中有一个方法,它返回复杂查询的结果
BookMember
.joins(" INNER JOIN notifications on notifications.reference = book_members.id")
.joins(:book)
.select("notifications.*,book_members.id as bookmemid, book_members.invited_by as invited_by, books.book_name as bookname, books.id as bookid")
.where("notifications.id in (?)",bookset)
我想用
测试它expect(real_result).to eq expected_result
如何生成expected_result
?