From d2a8f9a1ef74fa000dc30304b6fac2658a188931 Mon Sep 17 00:00:00 2001 From: GitBluub Date: Wed, 15 Nov 2023 13:36:29 +0100 Subject: [PATCH] fix: scoro test maybe --- scorometer/tests/runner.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scorometer/tests/runner.sh b/scorometer/tests/runner.sh index 316ad07..3879013 100755 --- a/scorometer/tests/runner.sh +++ b/scorometer/tests/runner.sh @@ -1,8 +1,8 @@ #!/bin/bash - -EMPTY_DB=$(curl localhost:3000/song/1 -s | jq '.statusCode == 404') +TOKEN=$(curl localhost:3000/auth/guest -X POST | jq '.access_token') +EMPTY_DB=$(curl localhost:3000/song/1 -s -H "Authorization: Bearer $TOKEN" | jq '.statusCode == 404') if [[ $EMPTY_DB == "true" ]]; then - curl localhost:3000/song -X POST --data '{"name": "SCORO_TEST", "difficulties": {}, "midiPath": "/assets/musics/SCORO_TEST/SCORO_TEST.midi", "musicXmlPath": "/assets/musics/SCORO_TEST/SCORO_TEST.mxl"}' -H "Content-Type: application/json" &> /dev/null + curl localhost:3000/song -H "Authorization: Bearer $TOKEN" -X POST --data '{"name": "SCORO_TEST", "difficulties": {}, "midiPath": "/assets/musics/SCORO_TEST/SCORO_TEST.midi", "musicXmlPath": "/assets/musics/SCORO_TEST/SCORO_TEST.mxl"}' -H "Content-Type: application/json" &> /dev/null fi TESTS_DONE=0 @@ -50,3 +50,4 @@ else exit $RET fi; +curl localhost:3000/auth/me -X DELETE -H "Authorization: Bearer $TOKEN"