我想在黄瓜测试中集成一个 ruby 代码:
FIX_TOKEN_FOR_TEST_COMPANY = "new_id"
FIX_ID_FOR_TEST_COMPANY = 184
Given ... do
end
When ... do
end
Then ... do
c = Company.find( FIX_ID_FOR_TEST_COMPANY );
c.confirmation_token = FIX_TOKEN_FOR_TEST_COMPANY
c.confirmed_at = nil;
Profile.find_by_email("cucumber@mail.de").destroy;
c.save(:validate => false)
end
这样对吗?
错误:找不到 ID=184 的公司 (ActiveRecord::RecordNotFound)
但是,如果我尝试在控制台(终端)中写入它就可以了。