Commit c2bdc3e0 authored by Aishwarya Subramanian's avatar Aishwarya Subramanian

Removed presence validation of job title

Explict check for non presence
parent dab7fb6c
......@@ -3,5 +3,5 @@
class UserDetail < ApplicationRecord
belongs_to :user
validates :job_title, presence: true, length: { maximum: 200 }
validates :job_title, length: { maximum: 200 }
end
......@@ -7,7 +7,7 @@ describe UserDetail do
describe 'validations' do
describe 'job_title' do
it { is_expected.to validate_presence_of(:job_title) }
it { is_expected.not_to validate_presence_of(:job_title) }
it { is_expected.to validate_length_of(:job_title).is_at_most(200) }
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment