Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SMPPIR-Node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
SMPPIR
SMPPIR-Node
Commits
d6517be0
Commit
d6517be0
authored
7 years ago
by
Vytor Calixto
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix_test_rateSchool' into release_v1.0.0
Merges
simcaq/simcaq-node!114
parents
36e12d51
59f80f7a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/rateSchool.js
+45
-37
45 additions, 37 deletions
src/test/rateSchool.js
with
45 additions
and
37 deletions
src/test/rateSchool.js
+
45
−
37
View file @
d6517be0
...
@@ -24,17 +24,16 @@ const server = require(`${libs}/app`);
...
@@ -24,17 +24,16 @@ const server = require(`${libs}/app`);
chai
.
use
(
chaiHttp
);
chai
.
use
(
chaiHttp
);
describe
(
'
request rate_school
'
,
()
=>
{
describe
(
'
request rate_school
'
,
()
=>
{
it
(
'
should
list default query rate school
'
,
(
done
)
=>
{
it
(
'
should
return 400 with no filters
'
,
(
done
)
=>
{
chai
.
request
(
server
)
chai
.
request
(
server
)
.
get
(
'
/api/v1/rate_school
'
)
.
get
(
'
/api/v1/rate_school
'
)
.
end
((
err
,
res
)
=>
{
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
2
00
);
res
.
should
.
have
.
status
(
4
00
);
res
.
should
.
be
.
json
;
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
should
.
have
.
property
(
'
error
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
error
.
should
.
be
.
equal
(
'
Wrong/No filter specified
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
total
'
);
done
();
done
();
})
;
})
});
});
it
(
'
should list the year range
'
,
(
done
)
=>
{
it
(
'
should list the year range
'
,
(
done
)
=>
{
...
@@ -133,106 +132,115 @@ describe('request rate_school', () => {
...
@@ -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
)
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
)
=>
{
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
ethnic_group_pnad_id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
name
'
);
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
();
done
();
});
});
});
});
it
(
'
should list the
extremes household income
'
,
(
done
)
=>
{
it
(
'
should list the
dimensions of gender
'
,
(
done
)
=>
{
chai
.
request
(
server
)
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
)
=>
{
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
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
();
done
();
});
});
});
});
it
(
'
should list
rate schools with dimension extremes
household income
'
,
(
done
)
=>
{
it
(
'
should list
fifth
household income
'
,
(
done
)
=>
{
chai
.
request
(
server
)
chai
.
request
(
server
)
.
get
(
'
/api/v1/rate_school
?dims=extremes
_household_income
'
)
.
get
(
'
/api/v1/
/
rate_school
/fifth
_household_income
'
)
.
end
((
err
,
res
)
=>
{
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
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
(
'
id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
total
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
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
'
);
done
();
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
)
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
)
=>
{
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
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
(
'
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
(
'
year
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
partial
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
denominator
'
);
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
();
done
();
});
});
});
});
it
(
'
should list
rate schools with dimension fifth
household income
'
,
(
done
)
=>
{
it
(
'
should list
extremes
household income
'
,
(
done
)
=>
{
chai
.
request
(
server
)
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
)
=>
{
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
total
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
year
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
name
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
partial
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
denominator
'
);
done
();
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
)
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
)
=>
{
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
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
(
'
extremes_household_income_id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
ethnic_group_pnad_name
'
);
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
();
done
();
});
});
});
});
it
(
'
should list
the dimensions of gender
'
,
(
done
)
=>
{
it
(
'
should list
year range
'
,
(
done
)
=>
{
chai
.
request
(
server
)
chai
.
request
(
server
)
.
get
(
'
/api/v1/rate_school
?dims=gender
'
)
.
get
(
'
/api/v1/
/
rate_school
/year_range
'
)
.
end
((
err
,
res
)
=>
{
.
end
((
err
,
res
)
=>
{
res
.
should
.
have
.
status
(
200
);
res
.
should
.
have
.
status
(
200
);
res
.
should
.
be
.
json
;
res
.
should
.
be
.
json
;
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
should
.
have
.
property
(
'
result
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
.
should
.
be
.
a
(
'
array
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
gender_pnad_id
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
start_year
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
g
end
er_pnad_name
'
);
res
.
body
.
result
[
0
].
should
.
have
.
property
(
'
end
_year
'
);
done
();
done
();
});
});
});
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment