Update user model specs (#334)

This commit is contained in:
Karthik Sivadas
2019-12-01 15:42:15 +05:30
committed by Sojan Jose
parent 84799fd0a1
commit 330e8625d3
2 changed files with 10 additions and 21 deletions

View File

@@ -60,10 +60,10 @@ class User < ApplicationRecord
# Used by the actionCable/PubSub Service we use for real time communications
has_secure_token :pubsub_token
validates_uniqueness_of :email, scope: :account_id
validates :email, presence: true
validates :name, presence: true
validates :account_id, presence: true
# The validation below has been commented out as it does not
# work because :validatable in devise overrides this.
# validates_uniqueness_of :email, scope: :account_id
validates :email, :name, :account_id, presence: true
enum role: [:agent, :administrator]