Browse Source

Add phone extension to the user export

pull/2652/head
Kat 2 years ago committed by kosiakkatrina
parent
commit
f5e57017cf
  1. 1
      app/services/exports/user_export_service.rb
  2. 2
      spec/fixtures/exports/user.xml
  3. 2
      spec/services/exports/user_export_service_spec.rb

1
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

2
spec/fixtures/exports/user.xml vendored

@ -8,7 +8,7 @@
<sign_in_count>5</sign_in_count>
<last_sign_in_at/>
<role>data_provider</role>
<phone>1234512345123</phone>
<phone>1234512345123 123</phone>
<is_dpo>false</is_dpo>
<is_key_contact>false</is_key_contact>
<active>true</active>

2
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)

Loading…
Cancel
Save