在我的rspec测试中,我的模型帖子有很多属性:
it { should respond_to(:title) }
it { should respond_to(:description) }
it { should respond_to(:instruction) }
.
.
.
我可以更准确,在测试中使用更少的行:
it { should respond_to(:title, :description, :instruction) }
答案 0 :(得分:0)
修复程序位于https://github.com/evansagge/mongoid-rspec:
it { should have_fields(:title, :description, :instruction) }
谢谢@Beerlington