diff --git a/app/lib/submission_builder/ty2024/states/md/documents/md502.rb b/app/lib/submission_builder/ty2024/states/md/documents/md502.rb index f8aa982453..d6b2b6035d 100644 --- a/app/lib/submission_builder/ty2024/states/md/documents/md502.rb +++ b/app/lib/submission_builder/ty2024/states/md/documents/md502.rb @@ -54,7 +54,7 @@ def document xml.AddressLine1Txt sanitize_for_xml(@intake.permanent_street, 30) xml.AddressLine2Txt sanitize_for_xml(@intake.permanent_apartment, 30) if @intake.permanent_apartment.present? xml.CityNm sanitize_for_xml(@intake.permanent_city, 20) - xml.StateAbbreviationCd @intake.direct_file_data.mailing_state.upcase + xml.StateAbbreviationCd "MD" xml.ZIPCd sanitize_zipcode(@intake.permanent_zip) end end diff --git a/spec/lib/submission_builder/ty2024/states/md/documents/md502_spec.rb b/spec/lib/submission_builder/ty2024/states/md/documents/md502_spec.rb index e4977f0c8e..3889153e5a 100644 --- a/spec/lib/submission_builder/ty2024/states/md/documents/md502_spec.rb +++ b/spec/lib/submission_builder/ty2024/states/md/documents/md502_spec.rb @@ -72,40 +72,27 @@ expect(xml.at("MarylandAddress ZIPCd").text).to eq "214011234" end - context "when user had an out-of-state permanent address from DF" do + context "when user had an out-of-state permanent address from DF and enters a new address in MD" do before do intake.direct_file_data.mailing_city = "Denver" intake.direct_file_data.mailing_state = "CO" intake.direct_file_data.mailing_zip = "80212-1234" + intake.confirmed_permanent_address_no! + intake.permanent_street = "313 Poppy Street" + intake.permanent_apartment = "Apt A" + intake.permanent_city = "Baltimore" + intake.permanent_zip = "21201-1234" end - it "outputs their DF address as their physical address" do - expect(xml.at("MarylandAddress AddressLine1Txt").text).to eq "312 Poppy Street" - expect(xml.at("MarylandAddress AddressLine2Txt").text).to eq "Apt B" - expect(xml.at("MarylandAddress CityNm").text).to eq "Denver" - expect(xml.at("MarylandAddress StateAbbreviationCd").text).to eq "CO" - expect(xml.at("MarylandAddress ZIPCd").text).to eq "802121234" + it "outputs their entered address as their physical address" do + expect(xml.at("MarylandAddress AddressLine1Txt").text).to eq "313 Poppy Street" + expect(xml.at("MarylandAddress AddressLine2Txt").text).to eq "Apt A" + expect(xml.at("MarylandAddress CityNm").text).to eq "Baltimore" + expect(xml.at("MarylandAddress StateAbbreviationCd").text).to eq "MD" + expect(xml.at("MarylandAddress ZIPCd").text).to eq "212011234" end end end - - context "when the user has entered a different permanent address" do - before do - intake.confirmed_permanent_address_no! - intake.permanent_street = "313 Poppy Street" - intake.permanent_apartment = "Apt A" - intake.permanent_city = "Baltimore" - intake.permanent_zip = "21201-1234" - end - - it "outputs their entered address as their physical address" do - expect(xml.at("MarylandAddress AddressLine1Txt").text).to eq "313 Poppy Street" - expect(xml.at("MarylandAddress AddressLine2Txt").text).to eq "Apt A" - expect(xml.at("MarylandAddress CityNm").text).to eq "Baltimore" - expect(xml.at("MarylandAddress StateAbbreviationCd").text).to eq "MD" - expect(xml.at("MarylandAddress ZIPCd").text).to eq "212011234" - end - end end context "when mailing address has the apt" do