@@ -40,18 +40,20 @@ class EthnicityUtilSpec extends AsyncWordSpec with MustMatchers with LarGenerato
40
40
val latinoLars = filterEthnicity(source(lars), HispanicOrLatino )
41
41
count(latinoLars).map(_ mustBe 100 )
42
42
}
43
- " exclude applications that do not meet 'Hispanic or Latino' criteria" in {
43
+ " exclude applications where applicant does not meet criteria" in {
44
44
val larsExcludedByApplicant = larCollection { lar =>
45
45
val applicant = lar.applicant.copy(ethnicity = 2 , coEthnicity = 3 )
46
46
lar.copy(applicant = applicant)
47
47
}
48
+ val nonLatinoLars1 = filterEthnicity(source(larsExcludedByApplicant), HispanicOrLatino )
49
+ count(nonLatinoLars1).map(_ mustBe 0 )
50
+ }
51
+ " exclude applications where coApplicant does not meet criteria" in {
48
52
val larsExcludedByCoApplicant = larCollection { lar =>
49
53
val applicant = lar.applicant.copy(ethnicity = 1 , coEthnicity = 2 )
50
54
lar.copy(applicant = applicant)
51
55
}
52
- val nonLatinoLars1 = filterEthnicity(source(larsExcludedByApplicant), HispanicOrLatino )
53
56
val nonLatinoLars2 = filterEthnicity(source(larsExcludedByCoApplicant), HispanicOrLatino )
54
- count(nonLatinoLars1).map(_ mustBe 0 )
55
57
count(nonLatinoLars2).map(_ mustBe 0 )
56
58
}
57
59
}
@@ -67,18 +69,20 @@ class EthnicityUtilSpec extends AsyncWordSpec with MustMatchers with LarGenerato
67
69
val nonLatinoLars = filterEthnicity(source(lars), NotHispanicOrLatino )
68
70
count(nonLatinoLars).map(_ mustBe 100 )
69
71
}
70
- " exclude applications that do not meet 'Not Hispanic/Latino' criteria" in {
72
+ " exclude applications where applicant does not meet criteria" in {
71
73
val larsExcludedByApplicant = larCollection { lar =>
72
74
val applicant = lar.applicant.copy(ethnicity = 1 , coEthnicity = 3 )
73
75
lar.copy(applicant = applicant)
74
76
}
77
+ val latinoLars1 = filterEthnicity(source(larsExcludedByApplicant), NotHispanicOrLatino )
78
+ count(latinoLars1).map(_ mustBe 0 )
79
+ }
80
+ " exclude applications where coApplicant does not meet criteria" in {
75
81
val larsExcludedByCoApplicant = larCollection { lar =>
76
82
val applicant = lar.applicant.copy(ethnicity = 2 , coEthnicity = 1 )
77
83
lar.copy(applicant = applicant)
78
84
}
79
- val latinoLars1 = filterEthnicity(source(larsExcludedByApplicant), NotHispanicOrLatino )
80
85
val latinoLars2 = filterEthnicity(source(larsExcludedByCoApplicant), NotHispanicOrLatino )
81
- count(latinoLars1).map(_ mustBe 0 )
82
86
count(latinoLars2).map(_ mustBe 0 )
83
87
}
84
88
}
@@ -106,19 +110,20 @@ class EthnicityUtilSpec extends AsyncWordSpec with MustMatchers with LarGenerato
106
110
}
107
111
108
112
" 'Joint' ethnicity filter" must {
109
- " include applications that meet 'Joint' criteria " in {
113
+ " include applications with hispanic applicant and non-hispanic coApplicant " in {
110
114
val lars1 = larCollection { lar =>
111
115
val applicant = lar.applicant.copy(ethnicity = 1 , coEthnicity = 2 )
112
116
lar.copy(applicant = applicant)
113
117
}
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 {
114
122
val lars2 = larCollection { lar =>
115
123
val applicant = lar.applicant.copy(ethnicity = 2 , coEthnicity = 1 )
116
124
lar.copy(applicant = applicant)
117
125
}
118
-
119
- val jointLars1 = filterEthnicity(source(lars1), Joint )
120
126
val jointLars2 = filterEthnicity(source(lars2), Joint )
121
- count(jointLars1).map(_ mustBe 100 )
122
127
count(jointLars2).map(_ mustBe 100 )
123
128
}
124
129
" exclude applications that do not meet 'Joint' criteria" in {
0 commit comments