0

rspec テストで、モデルの投稿に多数の属性があります。

it { should respond_to(:title) }
it { should respond_to(:description) }
it { should respond_to(:instruction) }
.
.
.

もっと正確に言えば、次のようなテストで使用する行を減らしてください。

it { should respond_to(:title, :description, :instruction) }
4

1 に答える 1

0

修正はhttps://github.com/evansagge/mongoid-rspecにあります:

it { should have_fields(:title, :description, :instruction) }

ありがとう@Beerlington

于 2012-07-20T10:19:50.337 に答える