【发布时间】:2012-06-19 17:05:56
【问题描述】:
Factory Girl 允许执行以下操作:
FactoryGirl define
factory :post do
content "some content"
styles "styles here"
team 1
end
end
但是,如果我在工厂块内尝试以下操作:
factory :post do
content "some content"
styles "styles here"
team 1
my_dictionary {'a' => 1, 'b' => 2}
end
my_dictionary 不会被解释为字典类型。我不知道如何将字典作为 FactoryGirl 中的属性。谁能帮我 ?
【问题讨论】:
标签: ruby-on-rails testing rspec factory-bot