chore: Upgrade rails and ruby versions (#2400)
ruby version: 3.0.2 rails version: 6.1.4
This commit is contained in:
@@ -8,9 +8,11 @@ describe ::ContactMergeAction do
|
||||
let!(:mergee_contact) { create(:contact, account: account) }
|
||||
|
||||
before do
|
||||
2.times.each { create(:conversation, contact: base_contact) }
|
||||
2.times.each { create(:conversation, contact: mergee_contact) }
|
||||
2.times.each { create(:message, sender: mergee_contact) }
|
||||
2.times.each do
|
||||
create(:conversation, contact: base_contact)
|
||||
create(:conversation, contact: mergee_contact)
|
||||
create(:message, sender: mergee_contact)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#perform' do
|
||||
|
||||
@@ -13,8 +13,10 @@ RSpec.describe '/api/v1/accounts/{account.id}/contacts/:id/conversations', type:
|
||||
|
||||
before do
|
||||
create(:inbox_member, user: agent, inbox: inbox_1)
|
||||
2.times.each { create(:conversation, account: account, inbox: inbox_1, contact: contact, contact_inbox: contact_inbox_1) }
|
||||
2.times.each { create(:conversation, account: account, inbox: inbox_2, contact: contact, contact_inbox: contact_inbox_2) }
|
||||
2.times.each do
|
||||
create(:conversation, account: account, inbox: inbox_1, contact: contact, contact_inbox: contact_inbox_1)
|
||||
create(:conversation, account: account, inbox: inbox_2, contact: contact, contact_inbox: contact_inbox_2)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'GET /api/v1/accounts/{account.id}/contacts/:id/conversations' do
|
||||
|
||||
@@ -3,7 +3,7 @@ FactoryBot.define do
|
||||
app_id { 'slack' }
|
||||
inbox
|
||||
account
|
||||
settings { { 'test': 'test' } }
|
||||
settings { { test: 'test' } }
|
||||
status { Integrations::Hook.statuses['enabled'] }
|
||||
access_token { SecureRandom.hex }
|
||||
reference_id { SecureRandom.hex }
|
||||
|
||||
@@ -23,7 +23,7 @@ require 'sidekiq/testing'
|
||||
# require only the support files necessary.
|
||||
#
|
||||
# rubocop:disable Rails/FilePath
|
||||
Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |f| require f }
|
||||
Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f }
|
||||
# rubocop:enable Rails/FilePath
|
||||
|
||||
# Checks for pending migrations and applies them before tests are run.
|
||||
@@ -79,4 +79,5 @@ end
|
||||
# Required for fixture_file_upload
|
||||
FactoryBot::SyntaxRunner.class_eval do
|
||||
include ActionDispatch::TestProcess
|
||||
include ActiveSupport::Testing::FileFixtures
|
||||
end
|
||||
|
||||
@@ -1,75 +1,76 @@
|
||||
module SlackStubs
|
||||
def slack_url_verification_stub
|
||||
{
|
||||
"token": 'Jhj5dZrVaK7ZwHHjRyZWjbDl',
|
||||
"challenge": '3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P',
|
||||
"type": 'url_verification'
|
||||
token: 'Jhj5dZrVaK7ZwHHjRyZWjbDl',
|
||||
challenge: '3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P',
|
||||
type: 'url_verification'
|
||||
}
|
||||
end
|
||||
|
||||
def slack_message_stub
|
||||
{
|
||||
"token": '[FILTERED]',
|
||||
"team_id": 'TLST3048H',
|
||||
"api_app_id": 'A012S5UETV4',
|
||||
"event": message_event,
|
||||
"type": 'event_callback',
|
||||
"event_id": 'Ev013QUX3WV6',
|
||||
"event_time": 1_588_623_033,
|
||||
"authed_users": '[FILTERED]',
|
||||
"webhook": {}
|
||||
token: '[FILTERED]',
|
||||
team_id: 'TLST3048H',
|
||||
api_app_id: 'A012S5UETV4',
|
||||
event: message_event,
|
||||
type: 'event_callback',
|
||||
event_id: 'Ev013QUX3WV6',
|
||||
event_time: 1_588_623_033,
|
||||
authed_users: '[FILTERED]',
|
||||
webhook: {}
|
||||
}
|
||||
end
|
||||
|
||||
def slack_message_stub_without_thread_ts
|
||||
{
|
||||
"token": '[FILTERED]',
|
||||
"team_id": '',
|
||||
"api_app_id": '',
|
||||
"event": {
|
||||
"type": 'message',
|
||||
"client_msg_id": 'ffc6e64e-6f0c-4a3d-b594-faa6b44e48ab',
|
||||
"text": 'this is test',
|
||||
"user": 'ULYPAKE5S',
|
||||
"ts": '1588623033.006000',
|
||||
"team": 'TLST3048H'
|
||||
token: '[FILTERED]',
|
||||
team_id: '',
|
||||
api_app_id: '',
|
||||
event: {
|
||||
type: 'message',
|
||||
client_msg_id: 'ffc6e64e-6f0c-4a3d-b594-faa6b44e48ab',
|
||||
text: 'this is test',
|
||||
user: 'ULYPAKE5S',
|
||||
ts: '1588623033.006000',
|
||||
team: 'TLST3048H'
|
||||
},
|
||||
"type": 'event_callback',
|
||||
"event_id": '',
|
||||
"event_time": 1_588_623_033,
|
||||
"authed_users": '[FILTERED]',
|
||||
"webhook": {}
|
||||
type: 'event_callback',
|
||||
event_id: '',
|
||||
event_time: 1_588_623_033,
|
||||
authed_users: '[FILTERED]',
|
||||
webhook: {}
|
||||
}
|
||||
end
|
||||
|
||||
def message_event
|
||||
{
|
||||
"client_msg_id": 'ffc6e64e-6f0c-4a3d-b594-faa6b44e48ab',
|
||||
"type": 'message',
|
||||
"text": 'this is test <https://chatwoot.com> Hey <@U019KT237LP|Sojan> Test again',
|
||||
"user": 'ULYPAKE5S',
|
||||
"ts": '1588623033.006000',
|
||||
"team": 'TLST3048H',
|
||||
"blocks": message_blocks,
|
||||
"thread_ts": '1588623023.005900',
|
||||
"channel": 'G01354F6A6Q',
|
||||
"event_ts": '1588623033.006000',
|
||||
"channel_type": 'group'
|
||||
|
||||
client_msg_id: 'ffc6e64e-6f0c-4a3d-b594-faa6b44e48ab',
|
||||
type: 'message',
|
||||
text: 'this is test <https://chatwoot.com> Hey <@U019KT237LP|Sojan> Test again',
|
||||
user: 'ULYPAKE5S',
|
||||
ts: '1588623033.006000',
|
||||
team: 'TLST3048H',
|
||||
blocks: message_blocks,
|
||||
thread_ts: '1588623023.005900',
|
||||
channel: 'G01354F6A6Q',
|
||||
event_ts: '1588623033.006000',
|
||||
channel_type: 'group'
|
||||
}
|
||||
end
|
||||
|
||||
def message_blocks
|
||||
[
|
||||
{
|
||||
"type": 'rich_text',
|
||||
"block_id": 'jaIv3',
|
||||
"elements": [
|
||||
type: 'rich_text',
|
||||
block_id: 'jaIv3',
|
||||
elements: [
|
||||
{
|
||||
"type": 'rich_text_section',
|
||||
"elements": [
|
||||
type: 'rich_text_section',
|
||||
elements: [
|
||||
{
|
||||
"type": 'text',
|
||||
"text": 'this is test'
|
||||
type: 'text',
|
||||
text: 'this is test'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user