1

我在 Rails 中有一个 ActiveRecord,它有一个序列化:file_names,Array 字段

在我的黄瓜 details.feature 中,我有以下内容:

Given the following dist_details exist
     | effective_date | company_id | file_names           | sent_at             |
     |     2012-03-01 |          1 | test1.pdf,test2.pdf  | 2012-04-01 13:00:00 |
     |     2012-04-01 |          2 | test3.pdf,test4.pdf  | 2012-04-01 14:00:00 |

当我运行黄瓜测试时,出现以下错误:

Attribute was supposed to be a Array, but was a String
(ActiveRecord::SerializationTypeMismatch)
      ./features/step_definitions/pickle_steps.rb:15:in `/^the following ((

如何自动填充文件名 test1.pdf、test2.pdf 的数组值?

4

0 回答 0