File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { Meteor } from 'meteor/meteor' ;
2
+ import { chai } from 'meteor/practicalmeteor:chai' ;
3
+ import { HTTP } from 'meteor/http'
4
+ import '../../../server/api/endpoints.js' ;
5
+ import '../../../server/secret/routers.js' ;
6
+
7
+ const address = 'http://localhost:3100' ;
8
+ const key = 'v1' ;
9
+ const arpTable = 'arp' ;
10
+ const name = 'candra' ;
11
+ const authToken = 'Bearer abcd' ;
12
+
13
+ describe ( 'arp' , function ( ) {
14
+ it ( 'accepts correct call' , function ( ) {
15
+ HTTP . call (
16
+ 'POST' ,
17
+ address + '/routerapi/v1/arp/' + name ,
18
+ { headers : { 'Authorization' : authToken } , body : { } } ,
19
+ function ( error , result ) {
20
+ console . log ( result ) ;
21
+ chai . assert ( ! error , 'there was an error: \n' + error ) ;
22
+ chai . assert . equal ( result . statusCode , 200 , 'Status code didn\'t match 200 it was ' + result . statusCode ) ;
23
+ }
24
+ ) ;
25
+ } ) ;
26
+ } ) ;
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ RouterApi.addRoute(
13
13
{
14
14
post ( ) {
15
15
16
+ console . log ( '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@' ) ;
17
+
16
18
var ARPEntries = App . Collections . ARPEntries ;
17
19
var APICalls = App . Collections . APICalls ;
18
20
var request = this . request ;
@@ -21,6 +23,8 @@ RouterApi.addRoute(
21
23
var routers = App . routers ;
22
24
var router = _ . findWhere ( routers , { name : this . urlParams . name } ) ;
23
25
26
+ console . log ( 'routers: ' + App . routers ) ;
27
+
24
28
if ( ! router ) {
25
29
return {
26
30
statusCode : 404 ,
You can’t perform that action at this time.
0 commit comments