Send emails via sidekiq (#380)

* add sidekiq web view if the user is an administrator

* add sidekiq setup configuration and support

* update devise to use delivery_later method and update test

* update conversation to use deliver_later instead of deliver

* Update Routes

* Add Procfile for Heroku One-Click Start

* updating docs

* update concurrency and Procfile for supporting Heroku Free Dyno

* update Procfile.dev
This commit is contained in:
Anto Dominic
2019-12-25 03:03:02 +05:30
committed by Sojan Jose
parent 335e7487e6
commit 4e9290ad76
13 changed files with 53 additions and 5 deletions

View File

@@ -6,7 +6,7 @@ RSpec.describe 'Confirmation Instructions', type: :mailer do
describe :notify do
let(:confirmable_user) { FactoryBot.build(:user, inviter: inviter_val) }
let(:inviter_val) { nil }
let(:mail) { confirmable_user.send_confirmation_instructions }
let(:mail) { Devise::Mailer.confirmation_instructions(confirmable_user, nil, {}) }
it 'has the correct header data' do
expect(mail.reply_to).to contain_exactly('accounts@chatwoot.com')

View File

@@ -35,7 +35,7 @@ RSpec.describe Conversation, type: :model do
allow(Rails.configuration.dispatcher).to receive(:dispatch)
allow(AssignmentMailer).to receive(:conversation_assigned).and_return(assignment_mailer)
allow(assignment_mailer).to receive(:deliver)
allow(assignment_mailer).to receive(:deliver_later)
Current.user = old_assignee
conversation.update(
@@ -68,7 +68,7 @@ RSpec.describe Conversation, type: :model do
# send_email_notification_to_assignee
expect(AssignmentMailer).to have_received(:conversation_assigned).with(conversation, new_assignee)
expect(assignment_mailer).to have_received(:deliver) if ENV.fetch('SMTP_ADDRESS', nil).present?
expect(assignment_mailer).to have_received(:deliver_later) if ENV.fetch('SMTP_ADDRESS', nil).present?
end
end