From b2b099e9f265dd021fb61684f970ebc0336edf49 Mon Sep 17 00:00:00 2001 From: Chris Gannon Date: Fri, 13 Oct 2023 12:11:38 +0100 Subject: [PATCH] fix headers on template CSVs --- .../components/bulk_ingredient_upload_form.rb | 4 +- .../spec/fixtures/files/exact_ingredients.csv | 2 +- .../files/exact_ingredients_duplicate_row.csv | 2 +- .../files/exact_ingredients_long_name.csv | 2 +- .../files/exact_ingredients_with_shades.csv | 2 +- .../spec/fixtures/files/range_ingredients.csv | 2 +- .../bulk_ingredient_upload_form_spec.rb | 40 +++++++++---------- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/cosmetics-web/app/forms/responsible_persons/notifications/components/bulk_ingredient_upload_form.rb b/cosmetics-web/app/forms/responsible_persons/notifications/components/bulk_ingredient_upload_form.rb index 6bf6c64691..a138b982e9 100644 --- a/cosmetics-web/app/forms/responsible_persons/notifications/components/bulk_ingredient_upload_form.rb +++ b/cosmetics-web/app/forms/responsible_persons/notifications/components/bulk_ingredient_upload_form.rb @@ -196,9 +196,9 @@ def ingredients_from_csv def csv_header_template if component.range? - headers = ["Ingredient name", "Minimum % w/w", "Maximum % w/w", "Exact % w/w", "CAS number", "Does NPIS need to know about it?"] + headers = ["Ingredient name", "Minimum % w/w", "Maximum % w/w", "Exact % w/w", "CAS number", "Does the NPIS need to be notified about this ingredient?"] else - headers = ["Ingredient name", "% w/w", "CAS number", "Does NPIS need to know about it?"] + headers = ["Ingredient name", "% w/w", "CAS number", "Does the NPIS need to be notified about this ingredient?"] headers << "Is it used for different shades?" if multiple_shades? end diff --git a/cosmetics-web/spec/fixtures/files/exact_ingredients.csv b/cosmetics-web/spec/fixtures/files/exact_ingredients.csv index a6f73cee24..2aef988554 100644 --- a/cosmetics-web/spec/fixtures/files/exact_ingredients.csv +++ b/cosmetics-web/spec/fixtures/files/exact_ingredients.csv @@ -1,4 +1,4 @@ -Ingredient name,% w/w,CAS number,Does NPIS need to know about it? +Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Sodium,35,498-19-8,false Aqua,65,,false ethanol,23,497-19-8,true diff --git a/cosmetics-web/spec/fixtures/files/exact_ingredients_duplicate_row.csv b/cosmetics-web/spec/fixtures/files/exact_ingredients_duplicate_row.csv index 5a1982d0e2..8aeee5e7c4 100644 --- a/cosmetics-web/spec/fixtures/files/exact_ingredients_duplicate_row.csv +++ b/cosmetics-web/spec/fixtures/files/exact_ingredients_duplicate_row.csv @@ -1,4 +1,4 @@ -Ingredient name,% w/w,CAS number,Does NPIS need to know about it? +Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Sodium,35,498-19-8,false Aqua,65,,false ethonol,23,497-19-8,true diff --git a/cosmetics-web/spec/fixtures/files/exact_ingredients_long_name.csv b/cosmetics-web/spec/fixtures/files/exact_ingredients_long_name.csv index fe42b4e9ec..729ccbedda 100755 --- a/cosmetics-web/spec/fixtures/files/exact_ingredients_long_name.csv +++ b/cosmetics-web/spec/fixtures/files/exact_ingredients_long_name.csv @@ -1,4 +1,4 @@ -Ingredient name,% w/w,CAS number,Does NPIS need to know about it? +Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Sodium,35,498-19-8,false Aqua,65,,true ethonol,23,497-19-8,false diff --git a/cosmetics-web/spec/fixtures/files/exact_ingredients_with_shades.csv b/cosmetics-web/spec/fixtures/files/exact_ingredients_with_shades.csv index 8ca37b595c..bf35d98c97 100644 --- a/cosmetics-web/spec/fixtures/files/exact_ingredients_with_shades.csv +++ b/cosmetics-web/spec/fixtures/files/exact_ingredients_with_shades.csv @@ -1,4 +1,4 @@ -Ingredient name,% w/w,CAS number,Does NPIS need to know about it?,Is it used for different shades? +Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient?,Is it used for different shades? Sodium,35,498-19-8,false,false Aqua,65,,false,true ethanol,23,497-19-8,true,true diff --git a/cosmetics-web/spec/fixtures/files/range_ingredients.csv b/cosmetics-web/spec/fixtures/files/range_ingredients.csv index 34ca36a8f5..3be2659960 100644 --- a/cosmetics-web/spec/fixtures/files/range_ingredients.csv +++ b/cosmetics-web/spec/fixtures/files/range_ingredients.csv @@ -1,4 +1,4 @@ -Ingredient name,Minimum % w/w,Maximum % w/w,Exact % w/w,CAS number,Does NPIS need to know about it? +Ingredient name,Minimum % w/w,Maximum % w/w,Exact % w/w,CAS number,Does the NPIS need to be notified about this ingredient? Sodium carbonate,10,30,,497-19-8,false Water,35,65,,7732-18-5,false Eucalyptol,,,12,,true diff --git a/cosmetics-web/spec/forms/responsible_persons/notifications/components/bulk_ingredient_upload_form_spec.rb b/cosmetics-web/spec/forms/responsible_persons/notifications/components/bulk_ingredient_upload_form_spec.rb index 3c2c8c02d1..96c0e68075 100644 --- a/cosmetics-web/spec/forms/responsible_persons/notifications/components/bulk_ingredient_upload_form_spec.rb +++ b/cosmetics-web/spec/forms/responsible_persons/notifications/components/bulk_ingredient_upload_form_spec.rb @@ -11,7 +11,7 @@ let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Sodium,35,497-19-8,true Aqua,65,497-19-8,false CSV @@ -117,7 +117,7 @@ context "when only a header row is present" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? CSV end @@ -144,7 +144,7 @@ context "when the file has too many columns in the header row but correct ingredient row values" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it?,Foo + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient?,Foo Aqua,65,497-19-8,false CSV end @@ -158,7 +158,7 @@ context "when the file has an extra empty column in the header row but correct ingredient row values" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it?, + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient?, Aqua,65,497-19-8,false CSV end @@ -172,7 +172,7 @@ context "when there are duplicate ingredients" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Aqua,65,497-19-8,false Aqua,50,497-19-8,false CSV @@ -188,7 +188,7 @@ # rubocop:disable Layout/HeredocIndentation let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Aqua,65,497-19-8,false, CSV end @@ -203,7 +203,7 @@ context "when an ingredient row has an extra column" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Aqua,65,497-19-8,false,bar CSV end @@ -217,7 +217,7 @@ context "when the ingredient name is empty" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? ,35,497-19-8,true CSV end @@ -231,7 +231,7 @@ context "when the ingredient name is too long" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,32,497-19-8,true CSV end @@ -245,7 +245,7 @@ context "when the ingredient concentration is empty" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Foo,,497-19-8,true CSV end @@ -259,7 +259,7 @@ context "when the ingredient concentration value is incorrect" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Sodium,abc,497-19-8,foo CSV end @@ -273,7 +273,7 @@ context "when the ingredient NPIS column is empty" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Aqua,65,497-19-8, CSV end @@ -287,7 +287,7 @@ context "when the ingredient NPIS column is incorrect" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Sodium,32,497-19-8,foo CSV end @@ -301,7 +301,7 @@ context "when one ingredient row is invalid" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Sodium,35,497-19-8,true Aqua,65,497-19-8,false Acid,50-75,497-19-8,false @@ -317,7 +317,7 @@ context "when multiple ingredient rows are invalid" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Sodium,thirtyfive,497-19-8,true Aqua,65,497-19-8,false Acid,50-75,497-19-8,false @@ -336,7 +336,7 @@ let(:csv) do <<~CSV - Ingredient name,Minimum % w/w,Maximum % w/w,Exact % w/w,CAS number,Does NPIS need to know about it? + Ingredient name,Minimum % w/w,Maximum % w/w,Exact % w/w,CAS number,Does the NPIS need to be notified about this ingredient? Sodium carbonate,10,30,,497-19-8,false Water,35,65,,7732-18-5,false Eucalyptol,,,12,,true @@ -358,7 +358,7 @@ context "when using upper case for toxicity" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Foo,12,497-19-8,TRUE CSV end @@ -389,7 +389,7 @@ context "when the fields start or end with extra spaces" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Foo,12 , 497-19-8 , TRUE CSV end @@ -410,7 +410,7 @@ context "when the file contains blank rows" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? ,,, Foo,12 ,497-19-8,TRUE CSV @@ -447,7 +447,7 @@ context "when ingredients are already present in product" do let(:csv) do <<~CSV - Ingredient name,% w/w,CAS number,Does NPIS need to know about it? + Ingredient name,% w/w,CAS number,Does the NPIS need to be notified about this ingredient? Sodium,35,497-19-8,true Aqua,65,497-19-8,false CSV