[英]devise/omniauth login with twitter - validation failed: email can't be blank
[英]Devise Model Shoulda Validation: Email can't be blank (I'm not testing Email)
我得到了一個名為候選人的設計模型。
我得到了這個測試:
it { expect(subject).to validate_presence_of(:democracyengine_recipient_id) }
模型中的這一行:
validates :democracyengine_recipient_id, presence: true
並且驗證有效(在其他測試中)。
但是在這個特定的測試中,我得到了這個錯誤:
Failure/Error: it { expect(subject).to validate_presence_of(:democracyengine_recipient_id) }
Expected errors to include "can't be blank" when democracyengine_recipient_id is set to nil, got errors: ["email can't be blank (\"\")", "password can't be blank (nil)"]
我如何解決它?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.