Skip to content

Commit 24da649

Browse files
committed
AsyncWordSpec can only handle one Future per spec
1 parent ce7c9d0 commit 24da649

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

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

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,20 @@ class EthnicityUtilSpec extends AsyncWordSpec with MustMatchers with LarGenerato
4040
val latinoLars = filterEthnicity(source(lars), HispanicOrLatino)
4141
count(latinoLars).map(_ mustBe 100)
4242
}
43-
"exclude applications that do not meet 'Hispanic or Latino' criteria" in {
43+
"exclude applications where applicant does not meet criteria" in {
4444
val larsExcludedByApplicant = larCollection { lar =>
4545
val applicant = lar.applicant.copy(ethnicity = 2, coEthnicity = 3)
4646
lar.copy(applicant = applicant)
4747
}
48+
val nonLatinoLars1 = filterEthnicity(source(larsExcludedByApplicant), HispanicOrLatino)
49+
count(nonLatinoLars1).map(_ mustBe 0)
50+
}
51+
"exclude applications where coApplicant does not meet criteria" in {
4852
val larsExcludedByCoApplicant = larCollection { lar =>
4953
val applicant = lar.applicant.copy(ethnicity = 1, coEthnicity = 2)
5054
lar.copy(applicant = applicant)
5155
}
52-
val nonLatinoLars1 = filterEthnicity(source(larsExcludedByApplicant), HispanicOrLatino)
5356
val nonLatinoLars2 = filterEthnicity(source(larsExcludedByCoApplicant), HispanicOrLatino)
54-
count(nonLatinoLars1).map(_ mustBe 0)
5557
count(nonLatinoLars2).map(_ mustBe 0)
5658
}
5759
}
@@ -67,18 +69,20 @@ class EthnicityUtilSpec extends AsyncWordSpec with MustMatchers with LarGenerato
6769
val nonLatinoLars = filterEthnicity(source(lars), NotHispanicOrLatino)
6870
count(nonLatinoLars).map(_ mustBe 100)
6971
}
70-
"exclude applications that do not meet 'Not Hispanic/Latino' criteria" in {
72+
"exclude applications where applicant does not meet criteria" in {
7173
val larsExcludedByApplicant = larCollection { lar =>
7274
val applicant = lar.applicant.copy(ethnicity = 1, coEthnicity = 3)
7375
lar.copy(applicant = applicant)
7476
}
77+
val latinoLars1 = filterEthnicity(source(larsExcludedByApplicant), NotHispanicOrLatino)
78+
count(latinoLars1).map(_ mustBe 0)
79+
}
80+
"exclude applications where coApplicant does not meet criteria" in {
7581
val larsExcludedByCoApplicant = larCollection { lar =>
7682
val applicant = lar.applicant.copy(ethnicity = 2, coEthnicity = 1)
7783
lar.copy(applicant = applicant)
7884
}
79-
val latinoLars1 = filterEthnicity(source(larsExcludedByApplicant), NotHispanicOrLatino)
8085
val latinoLars2 = filterEthnicity(source(larsExcludedByCoApplicant), NotHispanicOrLatino)
81-
count(latinoLars1).map(_ mustBe 0)
8286
count(latinoLars2).map(_ mustBe 0)
8387
}
8488
}
@@ -106,19 +110,20 @@ class EthnicityUtilSpec extends AsyncWordSpec with MustMatchers with LarGenerato
106110
}
107111

108112
"'Joint' ethnicity filter" must {
109-
"include applications that meet 'Joint' criteria" in {
113+
"include applications with hispanic applicant and non-hispanic coApplicant" in {
110114
val lars1 = larCollection { lar =>
111115
val applicant = lar.applicant.copy(ethnicity = 1, coEthnicity = 2)
112116
lar.copy(applicant = applicant)
113117
}
118+
val jointLars1 = filterEthnicity(source(lars1), Joint)
119+
count(jointLars1).map(_ mustBe 100)
120+
}
121+
"include applications with non-hispanic applicant and hispanic coApplicant" in {
114122
val lars2 = larCollection { lar =>
115123
val applicant = lar.applicant.copy(ethnicity = 2, coEthnicity = 1)
116124
lar.copy(applicant = applicant)
117125
}
118-
119-
val jointLars1 = filterEthnicity(source(lars1), Joint)
120126
val jointLars2 = filterEthnicity(source(lars2), Joint)
121-
count(jointLars1).map(_ mustBe 100)
122127
count(jointLars2).map(_ mustBe 100)
123128
}
124129
"exclude applications that do not meet 'Joint' criteria" in {

0 commit comments

Comments
 (0)