在我的 rspec 测试中,我的模型帖子有一堆属性:
it { should respond_to(:title) }
it { should respond_to(:description) }
it { should respond_to(:instruction) }
.
.
.
我可以更精确,在测试中使用更少的行,例如:
it { should respond_to(:title, :description, :instruction) }
在我的 rspec 测试中,我的模型帖子有一堆属性:
it { should respond_to(:title) }
it { should respond_to(:description) }
it { should respond_to(:instruction) }
.
.
.
我可以更精确,在测试中使用更少的行,例如:
it { should respond_to(:title, :description, :instruction) }
修复在https://github.com/evansagge/mongoid-rspec:
it { should have_fields(:title, :description, :instruction) }
谢谢@Beerlington