chore: Update dependencies to the latest versions (#5033)

This commit is contained in:
Sojan Jose
2022-07-15 04:51:59 +02:00
committed by GitHub
parent ea1a27c7d4
commit 4187428729
122 changed files with 546 additions and 526 deletions

View File

@@ -4,6 +4,6 @@ shared_examples_for 'access_tokenable' do
let(:obj) { create(described_class.to_s.underscore) }
it 'creates access token on create' do
expect(obj.access_token).not_to eq(nil)
expect(obj.access_token).not_to be_nil
end
end

View File

@@ -21,8 +21,8 @@ shared_examples_for 'assignment_handler' do
end
it 'creates team assigned and unassigned message activity' do
expect(conversation.update(team: team)).to eq true
expect(conversation.update(team: nil)).to eq true
expect(conversation.update(team: team)).to be true
expect(conversation.update(team: nil)).to be true
expect(Conversations::ActivityMessageJob).to(have_been_enqueued.at_least(:once)
.with(conversation, { account_id: conversation.account_id, inbox_id: conversation.inbox_id, message_type: :activity,
content: "Assigned to #{team.name} by #{agent.name}" }))
@@ -32,11 +32,11 @@ shared_examples_for 'assignment_handler' do
end
it 'changes assignee to nil if they doesnt belong to the team and allow_auto_assign is false' do
expect(team.allow_auto_assign).to eq false
expect(team.allow_auto_assign).to be false
conversation.update(team: team)
expect(conversation.reload.assignee).to eq nil
expect(conversation.reload.assignee).to be_nil
end
it 'changes assignee to a team member if allow_auto_assign is enabled' do
@@ -74,7 +74,7 @@ shared_examples_for 'assignment_handler' do
let(:assignment_mailer) { instance_double(AgentNotifications::ConversationNotificationsMailer, deliver: true) }
it 'assigns the agent to conversation' do
expect(update_assignee).to eq(true)
expect(update_assignee).to be(true)
expect(conversation.reload.assignee).to eq(agent)
end
@@ -82,7 +82,7 @@ shared_examples_for 'assignment_handler' do
# TODO: FIX me
# expect(EventDispatcherJob).to(have_been_enqueued.at_least(:once).with('assignee.changed', anything, anything, anything, anything))
expect(EventDispatcherJob).to(have_been_enqueued.at_least(:once))
expect(update_assignee).to eq(true)
expect(update_assignee).to be(true)
end
context 'when agent is current user' do
@@ -91,7 +91,7 @@ shared_examples_for 'assignment_handler' do
end
it 'creates self-assigned message activity' do
expect(update_assignee).to eq(true)
expect(update_assignee).to be(true)
expect(Conversations::ActivityMessageJob).to(have_been_enqueued.at_least(:once)
.with(conversation, { account_id: conversation.account_id, inbox_id: conversation.inbox_id,
message_type: :activity, content: "#{agent.name} self-assigned this conversation" }))

View File

@@ -14,21 +14,21 @@ shared_examples_for 'reauthorizable' do
it 'prompts reauthorization when error threshold is passed' do
obj = FactoryBot.create(model.to_s.underscore.tr('/', '_').to_sym)
expect(obj.reauthorization_required?).to eq false
expect(obj.reauthorization_required?).to be false
obj.class::AUTHORIZATION_ERROR_THRESHOLD.times do
obj.authorization_error!
end
expect(obj.reauthorization_required?).to eq true
expect(obj.reauthorization_required?).to be true
end
it 'prompt_reauthorization!' do
obj = FactoryBot.create(model.to_s.underscore.tr('/', '_').to_sym)
expect(obj.reauthorization_required?).to eq false
expect(obj.reauthorization_required?).to be false
obj.prompt_reauthorization!
expect(obj.reauthorization_required?).to eq true
expect(obj.reauthorization_required?).to be true
end
it 'reauthorized!' do
@@ -36,13 +36,13 @@ shared_examples_for 'reauthorizable' do
# setting up the object with the errors to validate its cleared on action
obj.authorization_error!
obj.prompt_reauthorization!
expect(obj.reauthorization_required?).to eq true
expect(obj.reauthorization_required?).to be true
expect(obj.authorization_error_count).not_to eq 0
obj.reauthorized!
# authorization errors are reset
expect(obj.authorization_error_count).to eq 0
expect(obj.reauthorization_required?).to eq false
expect(obj.reauthorization_required?).to be false
end
end

View File

@@ -31,7 +31,7 @@ shared_examples_for 'round_robin_handler' do
inbox.update(enable_auto_assignment: false)
# run_round_robin
expect(conversation.reload.assignee).to eq(nil)
expect(conversation.reload.assignee).to be_nil
end
it 'will not auto assign agent if its a bot conversation' do
@@ -45,7 +45,7 @@ shared_examples_for 'round_robin_handler' do
)
# run_round_robin
expect(conversation.reload.assignee).to eq(nil)
expect(conversation.reload.assignee).to be_nil
end
it 'gets triggered on update only when status changes to open' do