我有问题,我在轨 我从railstutorial.org学习项目,我在上市的有问题〜6.18 所以这是回购 https://github.com/Mroczeks/first_project 这是错误:没有ID哈特尔找不到用户轨教程
rails test
Running via Spring preloader in process 10776
Started with run options --seed 33787
FAIL["test_schould_be_valid", UserTest, 0.6801217989996076]
test_schould_be_valid#UserTest (0.68s)
Expected false to be truthy.
test/models/user_test.rb:9:in `block in <class:UserTest>'
ERROR["test_email_addresses_should_be_saved_as_lower-case", UserTest, 0.6879979369996363]
test_email_addresses_should_be_saved_as_lower-case#UserTest (0.69s)
ActiveRecord::RecordNotFound: ActiveRecord::RecordNotFound: Couldn't find User without an ID
test/models/user_test.rb:45:in `block in <class:UserTest>'
FAIL["test_email_validation_should_accept_valid_addresses", UserTest, 0.7056386839994957]
test_email_validation_should_accept_valid_addresses#UserTest (0.71s)
"[email protected]" should be valid
test/models/user_test.rb:32:in `block (2 levels) in <class:UserTest>'
test/models/user_test.rb:30:in `each'
test/models/user_test.rb:30:in `block in <class:UserTest>'
18/18: [=================================] 100% Time: 00:00:00, Time: 00:00:00
Finished in 0.78367s
18 tests, 29 assertions, 2 failures, 1 errors, 0 skips
“test/models/user_test.rb”文件中有什么? –
模型用户测试(名称,电子邮件和通过bcrypt)所以我测试例如密码是空的或具有指定数量的字符。 – Drekoo
https://github.com/Mroczeks/first_project/blob/master/test/models/user_test.rb – Drekoo