chore: Apply fixes for items in rubocop_todo [CW-1806] (#8864)

This PR addresses several items listed in our rubocop_todo by implementing the necessary corrections and enhancements. As a result, we are now able to remove the rubocop_todo file entirely, streamlining our codebase and ensuring adherence to our coding standards.

fixes: https://linear.app/chatwoot/issue/CW-1806/chore-rubocop-audit
This commit is contained in:
Sojan Jose
2024-02-07 13:36:04 +04:00
committed by GitHub
parent 3abb887445
commit 7776b74126
21 changed files with 67 additions and 398 deletions

View File

@@ -5,11 +5,11 @@ require 'rails_helper'
require Rails.root.join 'spec/models/concerns/avatarable_shared.rb'
RSpec.describe Contact do
context 'validations' do
context 'with validations' do
it { is_expected.to validate_presence_of(:account_id) }
end
context 'associations' do
context 'with associations' do
it { is_expected.to belong_to(:account) }
it { is_expected.to have_many(:conversations).dependent(:destroy_async) }
end
@@ -18,7 +18,7 @@ RSpec.describe Contact do
it_behaves_like 'avatarable'
end
context 'prepare contact attributes before validation' do
context 'when prepare contact attributes before validation' do
it 'sets email to lowercase' do
contact = create(:contact, email: 'Test@test.com')
expect(contact.email).to eq('test@test.com')