rspec, unknown attribute question

前端 未结 2 609
南笙
南笙 2021-02-07 12:19

I am working through the (excellent) railstutorial.org site have have a basic question about rspec.

When I run the below test on a new user model, I get an \"unknown att

相关标签:
2条回答
  • 2021-02-07 12:49

    The field may be missing from your test database, but present in your development database (which is why the console is working).

    Try making sure your migrations are all up to date and then update the test database:

    rake db:migrate
    rake db:test:prepare
    
    0 讨论(0)
  • 2021-02-07 13:06

    Did you run rake db:test:prepare?

    0 讨论(0)
提交回复
热议问题