Can someone tell me why my test keeps failing when I try to confirm uniqueness of the email attribute in my model. When I test this in the Rails console, it works correctly, but when I run the unit tests in the console, it fails with this error message:

This is my model:

And here is the unit test that keeps failing:

The reason the unit test keeps fai开发者_运维问答ling is that it says that invalid_user is valid when it shouldn't be. Can someone please help me figure out why this is failing -- it's getting on my nerves that I can't figure it out lol?
Thanks!
Your name and email fields should be database fields, not attr_accessors. Perhaps you meant to make this attr_accessible instead?
Try:
:uniqueness => true
I don't see the true part in there.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论