diff --git a/app/services/exports/user_export_service.rb b/app/services/exports/user_export_service.rb
index 207a0a045..fe228158c 100644
--- a/app/services/exports/user_export_service.rb
+++ b/app/services/exports/user_export_service.rb
@@ -61,6 +61,7 @@ module Exports
attribute_hash["role"] = user.role
attribute_hash["organisation_name"] = user.organisation.name
attribute_hash["active"] = user.active?
+ attribute_hash["phone"] = [user.phone, user.phone_extension].compact.join(" ")
attribute_hash
end
end
diff --git a/spec/fixtures/exports/user.xml b/spec/fixtures/exports/user.xml
index 98226c556..5652ac9c6 100644
--- a/spec/fixtures/exports/user.xml
+++ b/spec/fixtures/exports/user.xml
@@ -8,7 +8,7 @@
5
data_provider
- 1234512345123
+ 1234512345123 123
false
false
true
diff --git a/spec/services/exports/user_export_service_spec.rb b/spec/services/exports/user_export_service_spec.rb
index 1f0406d01..c488623da 100644
--- a/spec/services/exports/user_export_service_spec.rb
+++ b/spec/services/exports/user_export_service_spec.rb
@@ -42,7 +42,7 @@ RSpec.describe Exports::UserExportService do
end
context "and one user is available for export" do
- let!(:user) { create(:user, organisation:) }
+ let!(:user) { create(:user, organisation:, phone_extension: "123") }
it "generates a ZIP export file with the expected filename" do
expect(storage_service).to receive(:write_file).with(expected_zip_filename, any_args)