gpt4 book ai didi

ruby-on-rails - 如何使Mongoid的哈希类型字段的 pickle 步骤

转载 作者:行者123 更新时间:2023-12-04 03:33:32 25 4
gpt4 key购买 nike

class Person
include Mongoid::Document

field :address, :type => Hash

end

Given a person exist with address: {:city => "city", :street => "street"}

将未定义的步骤显示为:
Given /^a person exists with address: \{:city => "([^"]*)", :street => "([^"]*)"\}$/ do |arg1, arg2|
pending # express the regexp above with the code you wish you had
end

我如何使其成为标准的酱菜步骤?

最佳答案

我认为您不能在不创建自己的步骤定义的情况下一步一步地创建人和地址(这很简单)。您可以将特征分成两行,如下所示:

Given an address exists with city: "Townsville" and street: "123 Main St."
And a person exists with address: the address

关于ruby-on-rails - 如何使Mongoid的哈希类型字段的 pickle 步骤,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4313211/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com