diff --git a/db/migrate/20241028161228_make_claim_practitioner_email_address_citext.rb b/db/migrate/20241028161228_make_claim_practitioner_email_address_citext.rb new file mode 100644 index 0000000000..a0d79861cb --- /dev/null +++ b/db/migrate/20241028161228_make_claim_practitioner_email_address_citext.rb @@ -0,0 +1,15 @@ +class MakeClaimPractitionerEmailAddressCitext < ActiveRecord::Migration[7.0] + def change + enable_extension "citext" + + reversible do |dir| + dir.up do + change_column :claims, :practitioner_email_address, :citext + end + + dir.down do + change_column :claims, :practitioner_email_address, :string + end + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 47e4a0bc84..cbc797b252 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2024_10_28_110426) do +ActiveRecord::Schema[7.0].define(version: 2024_10_28_161228) do # These are extensions that must be enabled in order to support this database enable_extension "citext" enable_extension "pg_trgm" @@ -103,7 +103,7 @@ t.jsonb "onelogin_credentials", default: {} t.jsonb "onelogin_user_info", default: {} t.string "paye_reference" - t.string "practitioner_email_address" + t.citext "practitioner_email_address" t.string "provider_contact_name" t.text "onelogin_uid" t.datetime "onelogin_auth_at" diff --git a/spec/features/early_years_payment/practitioner/find_reference_spec.rb b/spec/features/early_years_payment/practitioner/find_reference_spec.rb index 99af7c0ae9..8cdc781a2d 100644 --- a/spec/features/early_years_payment/practitioner/find_reference_spec.rb +++ b/spec/features/early_years_payment/practitioner/find_reference_spec.rb @@ -10,6 +10,17 @@ ) end + scenario "when correct email address with different case" do + when_early_years_payment_practitioner_journey_configuration_exists + + visit "/early-years-payment-practitioner/find-reference?skip_landing_page=true&email=USER@example.com" + expect(page).to have_content "Enter your claim reference" + fill_in "Claim reference number", with: claim.reference + click_button "Submit" + + expect(page).to have_content "Sign in with GOV.UK One Login" + end + scenario "when different email address" do when_early_years_payment_practitioner_journey_configuration_exists