Skip to content

Commit a968c1f

Browse files
committed
Add spec for raceBorrowerCharacteristics
Leave two sets of specs commented -- need clarification on categorization logic
1 parent 361eeb0 commit a968c1f

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

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

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -172,17 +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 {
175+
/*"exclude lars where applicant does not meet criteria" in {
176+
// Ask about this --- can any of the races be 5?
176177
val excludedLars = larCollectionWithApplicant(_.copy(race1 = 2, race2 = "5"))
177178
val otherLars = filterRace(source(excludedLars), TwoOrMoreMinority)
178179
count(otherLars).map(_ mustBe 0)
179-
}
180+
}*/
180181
"exclude lars where coApplicant does not meet criteria" in {
181182
val excludedLars = larCollectionWithApplicant(_.copy(race1 = 1, race2 = "2", coRace1 = 5))
182183
val otherLars = filterRace(source(excludedLars), TwoOrMoreMinority)
183184
count(otherLars).map(_ mustBe 0)
184185
}
185186
}
187+
186188
/*
187189
"'Joint' race filter" must {
188190
"include applications that meet 'Joint' criteria" in {
@@ -204,29 +206,26 @@ class RaceUtilSpec extends AsyncWordSpec with MustMatchers with LarGenerators wi
204206
count(nonJointLars).map(_ mustBe 0)
205207
}
206208
}
209+
*/
207210

208-
*/
209-
210-
/*
211-
"ethnicityBorrowerCharacteristic" must {
212-
"generate a EthnicityBorrowCharacteristic with all 4 ethnicity categories and the specified dispositions" in {
211+
"raceBorrowerCharacteristic" must {
212+
"generate a RaceBorrowerCharacteristic with all 4 ethnicity categories and the specified dispositions" in {
213213
val lars = lar100ListGen.sample.get
214214
val dispositions = List(ReceivedDisp, OriginatedDisp)
215215

216-
val resultF = ethnicityBorrowerCharacteristic(source(lars), dispositions)
216+
val resultF = raceBorrowerCharacteristic(source(lars), dispositions)
217217

218218
resultF.map { result =>
219-
result mustBe a[EthnicityBorrowerCharacteristic]
219+
result mustBe a[RaceBorrowerCharacteristic]
220220

221-
result.ethnicities.size mustBe 4
221+
result.races.size mustBe 8
222222

223-
val firstEthCharacteristic = result.ethnicities.head
224-
firstEthCharacteristic mustBe a[EthnicityCharacteristic]
225-
firstEthCharacteristic.ethnicity mustBe HispanicOrLatino
223+
val firstEthCharacteristic = result.races.head
224+
firstEthCharacteristic mustBe a[RaceCharacteristic]
225+
firstEthCharacteristic.race mustBe AmericanIndianOrAlaskaNative
226226
firstEthCharacteristic.dispositions.map(_.disposition) mustBe List(ApplicationReceived, LoansOriginated)
227227
}
228228
}
229229
}
230-
*/
231230

232231
}

0 commit comments

Comments
 (0)