@@ -12,6 +12,7 @@ import org.scalatest.{ AsyncWordSpec, MustMatchers }
12
12
13
13
class RaceUtilSpec extends AsyncWordSpec with MustMatchers with SourceUtils with ApplicantSpecUtil {
14
14
15
+ def minority = Gen .oneOf(1 , 2 , 3 , 4 ).sample.get
15
16
def nonWhiteRaceGen = Gen .oneOf(" 1" , " 2" , " 3" , " 4" ).sample.get
16
17
def coApplicantNotWhite (app : Applicant ) = {
17
18
app.copy(coRace1 = nonWhiteRaceGen.toInt, coRace2 = nonWhiteRaceGen, coRace3 = nonWhiteRaceGen,
@@ -141,8 +142,6 @@ class RaceUtilSpec extends AsyncWordSpec with MustMatchers with SourceUtils with
141
142
}
142
143
143
144
" 'Two Or More Minority' race filter" must {
144
- def minority = Gen .oneOf(1 , 2 , 3 , 4 ).sample.get
145
-
146
145
" include applications that meet 'Two Or More Minority' criteria" in {
147
146
val lars = larCollectionWithApplicant { app =>
148
147
val withQualifyingCoApp = coApplicantNotWhite(app)
@@ -164,8 +163,6 @@ class RaceUtilSpec extends AsyncWordSpec with MustMatchers with SourceUtils with
164
163
}
165
164
166
165
" 'Joint' race filter" must {
167
- def minority = Gen .oneOf(1 , 2 , 3 , 4 ).sample.get
168
-
169
166
" include applications with white applicant and minority coApplicant" in {
170
167
val lars = larCollectionWithApplicant { app =>
171
168
app.copy(race1 = 5 , race2 = " " , race3 = " " , race4 = " " , race5 = " " , coRace1 = minority)
@@ -196,12 +193,9 @@ class RaceUtilSpec extends AsyncWordSpec with MustMatchers with SourceUtils with
196
193
197
194
}
198
195
" exclude lars with only one applicant" in {
199
- val excludedLars = larCollectionWithApplicant { app =>
200
- app.copy(race1 = minority, coRace1 = 8 )
201
- }
196
+ val excludedLars = larCollectionWithApplicant(_.copy(race1 = minority, coRace1 = 8 ))
202
197
val nonJointLars = filterRace(source(excludedLars), Joint )
203
198
count(nonJointLars).map(_ mustBe 0 )
204
-
205
199
}
206
200
}
207
201
0 commit comments