Skip to content

Commit

Permalink
FYST-1728 Fix MD client address updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tahsinaislam committed Jan 29, 2025
1 parent a4dacde commit 1f6f17f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1f6f17f

Please sign in to comment.