From 39775c563dcd9377696347b160e4adcfb6ec79cb Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 24 Oct 2024 10:24:30 +0100 Subject: [PATCH] wip --- .../eligible_fe_providers_importer_spec.rb | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/spec/models/eligible_fe_providers_importer_spec.rb b/spec/models/eligible_fe_providers_importer_spec.rb index 14fe3a1b3b..5a4cb62e44 100644 --- a/spec/models/eligible_fe_providers_importer_spec.rb +++ b/spec/models/eligible_fe_providers_importer_spec.rb @@ -114,5 +114,32 @@ def to_row(hash) end end end + + context "when currency values has GBP symbols and thousand separators" do + before do + file.write correct_headers + + 3.times do + file.write to_row(attributes_for(:eligible_fe_provider)) + end + + file.close + end + + it "ignores superfluous characters and imports new records" do + expect { subject.run }.to change { EligibleFeProvider.count }.by(3) + end + + context "when there are existing records" do + before do + create(:eligible_fe_provider) + create(:eligible_fe_provider, academic_year: AcademicYear.next) + end + + it "deletes them with new records" do + expect { subject.run }.to change { EligibleFeProvider.count }.by(2) + end + end + end end end