如何在(与)黄瓜代码中编写ruby代码?

时间:2012-10-25 09:40:01

标签: ruby google-chrome cucumber

我想在黄瓜测试中集成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)

但如果我尝试在控制台(终端)中写入,那就可以了。

0 个答案:

没有答案