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:
@@ -7,11 +7,11 @@ require Rails.root.join 'spec/models/concerns/avatarable_shared.rb'
|
||||
RSpec.describe User do
|
||||
let!(:user) { create(:user) }
|
||||
|
||||
context 'validations' do
|
||||
context 'with validations' do
|
||||
it { is_expected.to validate_presence_of(:email) }
|
||||
end
|
||||
|
||||
context 'associations' do
|
||||
context 'with associations' do
|
||||
it { is_expected.to have_many(:accounts).through(:account_users) }
|
||||
it { is_expected.to have_many(:account_users) }
|
||||
it { is_expected.to have_many(:assigned_conversations).class_name('Conversation').dependent(:nullify) }
|
||||
@@ -33,7 +33,7 @@ RSpec.describe User do
|
||||
it { expect(user.pubsub_token).not_to be_nil }
|
||||
it { expect(user.saved_changes.keys).not_to eq('pubsub_token') }
|
||||
|
||||
context 'rotates the pubsub_token' do
|
||||
context 'with rotate the pubsub_token' do
|
||||
it 'changes the pubsub_token when password changes' do
|
||||
pubsub_token = user.pubsub_token
|
||||
user.password = Faker::Internet.password(special_characters: true)
|
||||
@@ -68,7 +68,7 @@ RSpec.describe User do
|
||||
end
|
||||
end
|
||||
|
||||
context 'sso_auth_token' do
|
||||
context 'with sso_auth_token' do
|
||||
it 'can generate multiple sso tokens which can be validated' do
|
||||
sso_auth_token1 = user.generate_sso_auth_token
|
||||
sso_auth_token2 = user.generate_sso_auth_token
|
||||
|
||||
Reference in New Issue
Block a user