小编Raf*_*fal的帖子

Rake测试错误 - ActiveRecord :: Fixture :: FormatError:ActiveRecord :: Fixture :: FormatError

每次我做rake测试我得到12个错误都有相同的错误

8)错误:ProductTest#test_image_url:ActiveRecord :: Fixture :: FormatError:ActiveRecord :: Fixture :: FormatError

9)错误:ProductTest#test_product_attributes_must_not_be_empty:ActiveRecord :: Fixture :: FormatError:ActiveRecord :: Fixture :: FormatError

10)错误:ProductTest #test_product_is_not_valid_without_a_unique_title:ActiveRecord :: Fixture :: FormatError:ActiveRecord :: Fixture :: FormatError

11)错误:ProductTest#test_product_is_not_valid_without_a_unique_title _-_ i18n:ActiveRecord :: Fixture :: FormatError:ActiveRecord :: Fixture :: FormatError

12)错误:ProductTest#test_product_price_must_be_positive:ActiveRecord :: Fixture :: FormatError:ActiveRecord :: Fixture :: FormatError

第一行是:

syntax error, unexpected ( arg, expecting keyword_do or '{' or '('
  post :create, product_id: products (:ruby).id
Run Code Online (Sandbox Code Playgroud)

这是我的yaml文件

one:
title: MyString
description: MyText
image_url: MyString
price: 9.99

two:
title: MyString
description: …
Run Code Online (Sandbox Code Playgroud)

ruby testing activerecord ruby-on-rails rake-test

2
推荐指数
1
解决办法
2672
查看次数

标签 统计

activerecord ×1

rake-test ×1

ruby ×1

ruby-on-rails ×1

testing ×1