Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
simcaq-node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simcaq
simcaq-node
Merge requests
!114
Fix test in rate school
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix test in rate school
fix_test_rateSchool
into
release_v1.0.0
Overview
0
Commits
1
Pipelines
1
Changes
1
Merged
Fernando Erd
requested to merge
fix_test_rateSchool
into
release_v1.0.0
7 years ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Compare
release_v1.0.0
release_v1.0.0 (base)
and
latest version
latest version
59f80f7a
1 commit,
7 years ago
1 file
+
45
−
37
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/test/rateSchool.js
+
45
−
37
Options
@@ -24,17 +24,16 @@ const server = require(`${libs}/app`);
chai
.
use
(
chaiHttp
);
describe
(
'
request rate_school
'
,
()
=>
{
it
(
'
should
list default query rate school
'
,
(
done
)
=>
{
it
(
'
should
return 400 with no filters
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/rate_school
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
2
00
);
res
.
should
.
have
.
status
(
4
00
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
total
'
);
res
.
body
.
should
.
have
.
property
(
'
error
'
);
res
.
body
.
error
.
should
.
be
.
equal
(
'
Wrong/No filter specified
'
);
done
();
})
;
})
});
it
(
'
should list the year range
'
,
(
done
)
=>
{
@@ -133,106 +132,115 @@ describe('request rate_school', () => {
});
});
it
(
'
should list the fifth household income
'
,
(
done
)
=>
{
it
(
'
should list the dimensions of ethnic groups
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/rate_school
/fifth_household_income
'
)
.
get
(
'
/api/v1/
/
rate_school
?dims=ethnic_group_pnad&filter=min_year:"2015",max_year:"2015",age_range:["1"]
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
name
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
ethnic_group_pnad_id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
ethnic_group_pnad_name
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
year
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
denominator
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
partial
'
);
done
();
});
});
it
(
'
should list the
extremes household income
'
,
(
done
)
=>
{
it
(
'
should list the
dimensions of gender
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/rate_school
/extremes_household_income
'
)
.
get
(
'
/api/v1/
/
rate_school
?dims=gender&filter=min_year:"2015",max_year:"2015",age_range:["1"]
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
gender_id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
gender_name
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
year
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
denominator
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
partial
'
);
done
();
});
});
it
(
'
should list
rate schools with dimension extremes
household income
'
,
(
done
)
=>
{
it
(
'
should list
fifth
household income
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/rate_school
?dims=extremes
_household_income
'
)
.
get
(
'
/api/v1/
/
rate_school
/fifth
_household_income
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
extremes_household_income_id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
total
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
year
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
partial
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
denominator
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
name
'
);
done
();
});
});
it
(
'
should list
rate schools wi
th dimension fifth house
h
old income
'
,
(
done
)
=>
{
it
(
'
should list th
e
dimension
s of
fifth house
b
old income
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/rate_school?dims=fifth_household_income
'
)
.
get
(
'
/api/v1/
/
rate_school?dims=fifth_household_income
&filter=min_year:"2015",max_year:"2015",age_range:["1"]
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
fifth_household_income_id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
total
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
fifth_household_income_name
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
year
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
partial
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
denominator
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
partial
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
total
'
);
done
();
});
});
it
(
'
should list
rate schools with dimension fifth
household income
'
,
(
done
)
=>
{
it
(
'
should list
extremes
household income
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/rate_school
?filter=region:[1,2],min_year:2015
'
)
.
get
(
'
/api/v1/
/
rate_school
/extremes_household_income
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
total
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
year
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
partial
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
denominator
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
name
'
);
done
();
});
});
it
(
'
should list the dimensions of e
thnic groups
'
,
(
done
)
=>
{
it
(
'
should list the dimensions of e
xtremes housebold income
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/rate_school?dims=e
thnic_group_pnad
'
)
.
get
(
'
/api/v1/
/
rate_school?dims=e
xtremes_household_income&filter=min_year:"2015",max_year:"2015",age_range:["1"]
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
ethnic_group_pnad_id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
ethnic_group_pnad_name
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
extremes_household_income_id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
extremes_household_income_name
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
year
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
denominator
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
partial
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
total
'
);
done
();
});
});
it
(
'
should list
the dimensions of gender
'
,
(
done
)
=>
{
it
(
'
should list
year range
'
,
(
done
)
=>
{
chai
.
request
(
server
)
.
get
(
'
/api/v1/rate_school
?dims=gender
'
)
.
get
(
'
/api/v1/
/
rate_school
/year_range
'
)
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
gender_pnad_id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
g
end
er_pnad_name
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
start_year
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
end
_year
'
);
done
();
});
});
Loading