adding index to email column culprit for unit tests failing

后端 未结 2 411
天涯浪人
天涯浪人 2020-12-29 05:57

I am new to devise and rails and I just integrated devise with my sample app. What I noticed is after creating a user model, all my unit tests were failing. I went

2条回答
  •  攒了一身酷
    2020-12-29 06:22

    If you just generated the devise model, a fixture was also generated with more or less this content:

    one: {}
    # column: value
    #
    two: {}
    #  column: value
    

    This fixture tries to create two users, with the same (inexistant) email. Replace it by:

    one:
      email: test1@test.com
    
    two:
      email: test2@test.com
    

    It will fix this error.

提交回复
热议问题