【发布时间】:2015-10-14 06:04:52
【问题描述】:
我正在使用 ruby -v 2.2.3 & rails -v 4.2.4 。我在注册后尝试使用 $ bundle exec rake test 命令进行测试,但是终端抛出了很多错误。错误是 1) 错误: SessionsControllerTest#test_should_get_new: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
错误: SessionsControllerTest#test_should_get_new: NoMethodError: nil:NilClass 的未定义方法“每个”
2) 错误: 用户控制器测试#test_should_get_new: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
错误: 用户控制器测试#test_should_get_new: NoMethodError: nil:NilClass 的未定义方法“每个”
3) 错误: ZapsControllerTest#test_should_get_about: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
错误: ZapsControllerTest#test_should_get_about: NoMethodError: nil:NilClass 的未定义方法“每个”
4) 错误: ZapsControllerTest#test_should_get_home: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
错误: ZapsControllerTest#test_should_get_home: NoMethodError: nil:NilClass 的未定义方法“每个”
5) 错误: ZapsControllerTest#test_should_get_contact: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
错误: ZapsControllerTest#test_should_get_contact: NoMethodError: nil:NilClass 的未定义方法“每个”
6) 错误: ZapsControllerTest#test_should_get_help: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
错误: ZapsControllerTest#test_should_get_help: NoMethodError: nil:NilClass 的未定义方法“每个”
7) 错误: SiteLayoutTest#test_layout_links: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
错误: SiteLayoutTest#test_layout_links: NoMethodError: nil:NilClass 的未定义方法“每个”
8) 错误: UsersSignupTest#test_invalid_signup_information: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
错误: UsersSignupTest#test_invalid_signup_information: NoMethodError: nil:NilClass 的未定义方法“每个”
9) 错误: UserTest#test_password_should_have_a_minimum_length: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
10) 错误: 用户测试#test_name_should_be_present: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
11) 错误: 用户测试#test_email_should_not_be_too_long: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
12) 错误: UserTest#test_email_validation_should_reject_invalid_addresses: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
13) 错误: 用户测试#test_email_should_be_present: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
14) 错误: UserTest#test_password_should_be_present_(非空白): ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
15) 错误: 用户测试#test_should_be_valid: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
16) 错误: 用户测试#test_name_should_not_be_too_long: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
17) 错误: UserTest#test_email_addresses_should_be_unique: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
18) 错误: UserTest#test_email_validation_should_accept_valid_addresses: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
19) 错误: 用户登录测试#test_login_with_invalid_information: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
错误: 用户登录测试#test_login_with_invalid_information: NoMethodError: nil:NilClass 的未定义方法“每个”
20) 错误: 用户登录测试#test_login_with_valid_information: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError
错误: 用户登录测试#test_login_with_valid_information: NoMethodError: nil:NilClass 的未定义方法“每个”
20 次运行,0 次断言,0 次失败,20 次错误,0 次跳过
users.yml 文件中的代码是
在http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 阅读有关灯具的信息
潘卡吉: 姓名:潘卡杰 电子邮件:pankajbarhate13@gmail.com password_digest:
请给我解决问题的方法。
【问题讨论】:
-
Stackoverflow 是就具体问题提出具体问题的地方 - 您不能只是将整个项目都放在一个问题中,然后指望有人为您完成工作。
标签: ruby-on-rails