我想在黄瓜测试中集成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)
但如果我尝试在控制台(终端)中写入,那就可以了。