Skip to content

Commit a5da77a

Browse files
committed
Update spec logic to match race category logic
1 parent ef3cfdb commit a5da77a

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

publication/src/test/scala/hmda/publication/reports/RaceUtilSpec.scala

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,22 +172,19 @@ class RaceUtilSpec extends AsyncWordSpec with MustMatchers with LarGenerators wi
172172
val multiMinorityLars = filterRace(source(lars), TwoOrMoreMinority)
173173
count(multiMinorityLars).map(_ mustBe 100)
174174
}
175-
/*"exclude lars where applicant does not meet criteria" in {
176-
// TODO: Confirm with BAs--can any of the races be 5?
177-
val excludedLars = larCollectionWithApplicant(_.copy(race1 = 2, race2 = "5"))
175+
"exclude lars where applicant does not meet criteria" in {
176+
val excludedLars = larCollectionWithApplicant(_.copy(race2 = "", race3 = "", race4 = "", race5 = ""))
178177
val otherLars = filterRace(source(excludedLars), TwoOrMoreMinority)
179178
count(otherLars).map(_ mustBe 0)
180-
}*/
179+
}
181180
"exclude lars where coApplicant does not meet criteria" in {
182181
val excludedLars = larCollectionWithApplicant(_.copy(race1 = 1, race2 = "2", coRace1 = 5))
183182
val otherLars = filterRace(source(excludedLars), TwoOrMoreMinority)
184183
count(otherLars).map(_ mustBe 0)
185184
}
186185
}
187186

188-
/*
189187
"'Joint' race filter" must {
190-
// TODO: Confirm with BAs--how to define "minority" here?
191188
def minority = Gen.oneOf(1, 2, 3, 4).sample.get
192189

193190
"include applications with white applicant and minority coApplicant" in {
@@ -205,13 +202,15 @@ class RaceUtilSpec extends AsyncWordSpec with MustMatchers with LarGenerators wi
205202
count(jointLars).map(_ mustBe 100)
206203
}
207204
"exclude lars with two white applicants" in {
208-
val excludedLars = larCollectionWithApplicant(_.copy(race1 = 5, coRace1 = 5))
205+
val excludedLars = larCollectionWithApplicant(_.copy(race1 = 5, coRace1 = 5, race2 = "", coRace2 = "",
206+
race3 = "", coRace3 = "", race4 = "", coRace4 = "", race5 = "", coRace5 = ""))
209207
val nonJointLars = filterRace(source(excludedLars), Joint)
210208
count(nonJointLars).map(_ mustBe 0)
211209
}
212210
"exclude lars with two minority applicants" in {
213211
val excludedLars = larCollectionWithApplicant { app =>
214-
app.copy(race1 = minority, coRace1 = minority)
212+
app.copy(race1 = minority, coRace1 = minority, race2 = "", race3 = "", race4 = "",
213+
race5 = "", coRace2 = "", coRace3 = "", coRace4 = "", coRace5 = "")
215214
}
216215
val nonJointLars = filterRace(source(excludedLars), Joint)
217216
count(nonJointLars).map(_ mustBe 0)
@@ -226,7 +225,6 @@ class RaceUtilSpec extends AsyncWordSpec with MustMatchers with LarGenerators wi
226225

227226
}
228227
}
229-
*/
230228

231229
"raceBorrowerCharacteristic" must {
232230
"generate a RaceBorrowerCharacteristic with all 4 ethnicity categories and the specified dispositions" in {

0 commit comments

Comments
 (0)