【发布时间】:2020-11-27 09:30:36
【问题描述】:
我正在尝试通过 rspec 测试 where.not 的参数,但找不到用于在 Active Record 上进行调用的函数。谁能告诉我如何在rspec 中模拟where.not 的课程?我尝试了以下方法:
MyClass.should_receive(:where).not
MyClass.should_receive(:where_not)
MyClass.should_receive(:not_where)
任何帮助将不胜感激!
【问题讨论】:
标签: ruby-on-rails activerecord rspec