feat: Export contact improvements (#8895)
This pull request enhances the export contacts feature by adding a confirmation step before exporting. Previously, clicking the export button would trigger the export action without confirmation. Additionally, it ensures that only the intended recipient receives the export email, addressing the previous behaviour where all administrators received it. Fixes: #8504 Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
@@ -197,7 +197,7 @@ RSpec.describe 'Contacts API', type: :request do
|
||||
let(:admin) { create(:user, account: account, role: :administrator) }
|
||||
|
||||
it 'enqueues a contact export job' do
|
||||
expect(Account::ContactsExportJob).to receive(:perform_later).with(account.id, nil).once
|
||||
expect(Account::ContactsExportJob).to receive(:perform_later).with(account.id, nil, admin.email).once
|
||||
|
||||
get "/api/v1/accounts/#{account.id}/contacts/export",
|
||||
headers: admin.create_new_auth_token,
|
||||
@@ -207,7 +207,7 @@ RSpec.describe 'Contacts API', type: :request do
|
||||
end
|
||||
|
||||
it 'enqueues a contact export job with sent_columns' do
|
||||
expect(Account::ContactsExportJob).to receive(:perform_later).with(account.id, %w[phone_number email]).once
|
||||
expect(Account::ContactsExportJob).to receive(:perform_later).with(account.id, %w[phone_number email], admin.email).once
|
||||
|
||||
get "/api/v1/accounts/#{account.id}/contacts/export",
|
||||
headers: admin.create_new_auth_token,
|
||||
|
||||
Reference in New Issue
Block a user