【发布时间】:2017-03-30 15:55:31
【问题描述】:
我在测试中使用了固定装置。
例如:
post bookings_path, params: { journal: { from_account_number: "1",
from_account: "Test",
from_amount: "12",
to_account_number: "2",
to_account: "Test2",
to_amount: "12"
} }
可以换吗
from_account_number: "1",
from_account: "Test",
from_amount: "12",
to_account_number: "2",
to_account: "Test2",
to_amount: "12"
只有一个夹具调用?
【问题讨论】:
-
你应该使用工厂。 FactoryGirl 是个不错的选择
标签: ruby-on-rails ruby testing fixtures