@@ -127,10 +127,10 @@ class RaceUtilSpec extends AsyncWordSpec with MustMatchers with LarGenerators wi
127
127
128
128
" 'White' race filter" must {
129
129
" include applications that meet 'White' criteria" in {
130
- def nonWhiteCoApp = Gen .oneOf(5 , 6 , 7 , 8 ).sample.get
130
+ def nonMinorityCoApp = Gen .oneOf(5 , 6 , 7 , 8 ).sample.get
131
131
val lars = larCollectionWithApplicant { app =>
132
132
val whiteApp = app.copy(race1 = 5 , race2 = " " , race3 = " " , race4 = " " , race5 = " " )
133
- whiteApp.copy(coRace1 = nonWhiteCoApp , coRace2 = " " , coRace3 = " " , coRace4 = " " , coRace5 = " " )
133
+ whiteApp.copy(coRace1 = nonMinorityCoApp , coRace2 = " " , coRace3 = " " , coRace4 = " " , coRace5 = " " )
134
134
}
135
135
val whiteLars = filterRace(source(lars), White )
136
136
count(whiteLars).map(_ mustBe 100 )
@@ -173,7 +173,7 @@ class RaceUtilSpec extends AsyncWordSpec with MustMatchers with LarGenerators wi
173
173
count(multiMinorityLars).map(_ mustBe 100 )
174
174
}
175
175
/* "exclude lars where applicant does not meet criteria" in {
176
- // Ask about this --- can any of the races be 5?
176
+ // TODO: Confirm with BAs-- can any of the races be 5?
177
177
val excludedLars = larCollectionWithApplicant(_.copy(race1 = 2, race2 = "5"))
178
178
val otherLars = filterRace(source(excludedLars), TwoOrMoreMinority)
179
179
count(otherLars).map(_ mustBe 0)
@@ -187,23 +187,43 @@ class RaceUtilSpec extends AsyncWordSpec with MustMatchers with LarGenerators wi
187
187
188
188
/*
189
189
"'Joint' race filter" must {
190
- "include applications that meet 'Joint' criteria" in {
191
- val lars = larCollection { lar =>
190
+ // TODO: Confirm with BAs--how to define "minority" here?
191
+ def minority = Gen.oneOf(1, 2, 3, 4).sample.get
192
+
193
+ "include applications with white applicant and minority coApplicant" in {
194
+ val lars = larCollectionWithApplicant { app =>
195
+ app.copy(race1 = 5, race2 = "", race3 = "", race4 = "", race5 = "", coRace1 = minority)
196
+ }
197
+ val jointLars = filterRace(source(lars), Joint)
198
+ count(jointLars).map(_ mustBe 100)
199
+ }
200
+ "include applications with minority applicant and white coApplicant" in {
201
+ val lars = larCollectionWithApplicant { app =>
202
+ app.copy(race1 = minority, coRace1 = 5, coRace2 = "", coRace3 = "", coRace4 = "", coRace5 = "")
192
203
}
193
204
val jointLars = filterRace(source(lars), Joint)
194
205
count(jointLars).map(_ mustBe 100)
195
206
}
196
- "exclude applications that do not meet 'Joint' criteria" in {
197
- val larsExcludedByApplicant = larCollection { lar =>
198
- val applicant = lar.applicant.copy(ethnicity = 2, coEthnicity = 3)
199
- lar.copy(applicant = applicant)
207
+ "exclude lars with two white applicants" in {
208
+ val excludedLars = larCollectionWithApplicant(_.copy(race1 = 5, coRace1 = 5))
209
+ val nonJointLars = filterRace(source(excludedLars), Joint)
210
+ count(nonJointLars).map(_ mustBe 0)
211
+ }
212
+ "exclude lars with two minority applicants" in {
213
+ val excludedLars = larCollectionWithApplicant { app =>
214
+ app.copy(race1 = minority, coRace1 = minority)
200
215
}
201
- val larsExcludedByCoApplicant = larCollection { lar =>
202
- val applicant = lar.applicant.copy(ethnicity = 1, coEthnicity = 2)
203
- lar.copy(applicant = applicant)
216
+ val nonJointLars = filterRace(source(excludedLars), Joint)
217
+ count(nonJointLars).map(_ mustBe 0)
218
+
219
+ }
220
+ "exclude lars with only one applicant" in {
221
+ val excludedLars = larCollectionWithApplicant { app =>
222
+ app.copy(race1 = minority, coRace1 = 8)
204
223
}
205
- val nonJointLars = filterRace(source(lars ), Joint)
224
+ val nonJointLars = filterRace(source(excludedLars ), Joint)
206
225
count(nonJointLars).map(_ mustBe 0)
226
+
207
227
}
208
228
}
209
229
*/
0 commit comments