chore: Auto capitalize the last name field while sending the canned response/variables (#6767)

* Capitalize last name

* Add more spec

* Fix last name spec issue

* More spec fixes

* Add more spec fixes

* Update user_drop_spec.rb
This commit is contained in:
Muhsin Keloth
2023-03-28 13:03:51 +05:30
committed by GitHub
parent 4c10845acd
commit 3535a1a708
6 changed files with 51 additions and 17 deletions

View File

@@ -13,7 +13,12 @@ describe ::ContactDrop do
it('return the capitalized name') do
contact.update!(name: 'john doe')
expect(subject.name).to eq 'John doe'
expect(subject.name).to eq 'John Doe'
end
it('return the capitalized first name') do
contact.update!(name: 'john doe')
expect(subject.last_name).to eq 'Doe'
end
end
@@ -27,5 +32,10 @@ describe ::ContactDrop do
contact.update!(name: 'John')
expect(subject.last_name).to be_nil
end
it('return the capitalized last name') do
contact.update!(name: 'john doe')
expect(subject.last_name).to eq 'Doe'
end
end
end

View File

@@ -10,6 +10,11 @@ describe ::UserDrop do
user.update!(name: 'John Doe')
expect(subject.first_name).to eq 'John'
end
it('return the capitalized first name') do
user.update!(name: 'john doe')
expect(subject.first_name).to eq 'John'
end
end
it('return the capitalized name') do
@@ -27,5 +32,10 @@ describe ::UserDrop do
user.update!(name: 'John')
expect(subject.last_name).to be_nil
end
it('return the capitalized last name') do
user.update!(name: 'john doe')
expect(subject.last_name).to eq 'Doe'
end
end
end