作者:咸菜地瓜的丽质人生知_467 | 来源:互联网 | 2023-05-18 20:17
我刚刚通过Hartl教程的第8章,但在我尝试运行测试时仍然遇到错误.我得到3个相同的错误,问题似乎源于用户登录测试,其中夹具:michael未在夹具集(用户)中找到.
这是我的user_login_test
require 'test_helper'
class UsersLoginTest
这是错误
ERROR["test_login_with_invalid_information", UsersLoginTest, 0.006789]
test_login_with_invalid_information#UsersLoginTest (0.01s)
StandardError: StandardError: No fixture named 'michael' found for fixture set 'users'
test/integration/users_login_test.rb:6:in `setup'
test/integration/users_login_test.rb:6:in `setup'
ERROR["test_login_with_valid_information", UsersLoginTest, 0.008174]
test_login_with_valid_information#UsersLoginTest (0.01s)
StandardError: StandardError: No fixture named 'michael' found for fixture set 'users'
test/integration/users_login_test.rb:6:in `setup'
test/integration/users_login_test.rb:6:in `setup'
DEPRECATION WARNING: The assertion was not run because of an invalid css selector.
unexpected '#' after '[#]' (called from block in at /Users/SamDavidoff/Documents/workspace/sample_app/test/integration/users_signup_test.rb:14)
DEPRECATION WARNING: The assertion was not run because of an invalid css selector.
unexpected '<' after '.' (called from block in at /Users/SamDavidoff/Documents/workspace/sample_app/test/integration/users_signup_test.rb:15)
ERROR["test_valid_signup_information", UsersSignupTest, 0.197435]
test_valid_signup_information#UsersSignupTest (0.20s)
NoMethodError: NoMethodError: undefined method `is_logged_in?' for #
test/integration/users_signup_test.rb:27:in `block in '
test/integration/users_signup_test.rb:27:in `block in '
Andrey Demid..
5
您没有在文件test/fixtures/users.yml中创建用户
1> Andrey Demid..:
您没有在文件test/fixtures/users.yml中创建用户