File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -495,8 +495,7 @@ const migrate = async (req, res) => {
495
495
await batchWrite . commit ( ) ;
496
496
}
497
497
498
- return res . staus ( 200 ) . json ( {
499
- statusCode : 200 ,
498
+ return res . status ( 200 ) . json ( {
500
499
message : "All Users github_user_id added successfully" ,
501
500
} ) ;
502
501
} catch ( error ) {
Original file line number Diff line number Diff line change @@ -1039,6 +1039,15 @@ describe("Users", function () {
1039
1039
} ) ;
1040
1040
1041
1041
describe ( "POST /users/migrate" , function ( ) {
1042
+ beforeEach ( async function ( ) {
1043
+ superUserId = await addUser ( superUser ) ;
1044
+ superUserAuthToken = authService . generateAuthToken ( { userId : superUserId } ) ;
1045
+ } ) ;
1046
+
1047
+ afterEach ( async function ( ) {
1048
+ await cleanDb ( ) ;
1049
+ } ) ;
1050
+
1042
1051
it ( "Should return 401 when user is unauthorize" , function ( done ) {
1043
1052
chai
1044
1053
. request ( app )
@@ -1059,7 +1068,6 @@ describe("Users", function () {
1059
1068
. set ( "Cookie" , `${ cookieName } =${ superUserAuthToken } ` ) ;
1060
1069
expect ( response1 ) . to . have . status ( 200 ) ;
1061
1070
expect ( response1 . body ) . to . eql ( {
1062
- statusCode : 201 ,
1063
1071
message : `All Users github_user_id added successfully` ,
1064
1072
} ) ;
1065
1073
const response2 = await chai . request ( app ) . get ( `/users` ) . set ( "cookie" , `${ cookieName } =${ superUserAuthToken } ` ) ;
You can’t perform that action at this time.
0 commit comments