Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何使Cumber不从数据库中删除一条记录?_Ruby On Rails - Fatal编程技术网

Ruby on rails 如何使Cumber不从数据库中删除一条记录?

Ruby on rails 如何使Cumber不从数据库中删除一条记录?,ruby-on-rails,Ruby On Rails,Cucumber在每次运行前清理测试数据库 但我有几个值应该总是在数据库中 (“默认”值) 有没有办法告诉Cucumber不要删除某些值? 还是在每次运行之前创建mb 只需将其放在背景部分的给定块中即可 e、 g 希望这有帮助 Background: Given I have an item that exists Given /^I have and item that exists$/ do Item.create!(item_name: 'Name') end

Cucumber在每次运行前清理测试数据库

但我有几个值应该总是在数据库中
(“默认”值)

有没有办法告诉Cucumber不要删除某些值?

还是在每次运行之前创建mb

只需将其放在背景部分的给定块中即可

e、 g

希望这有帮助

Background:
  Given I have an item that exists

Given /^I have and item that exists$/ do
  Item.create!(item_name: 'Name')
end