@@ -4,38 +4,38 @@ base_url=${1:-localhost\:5000}
44
55# Wait until server is online
66for i in $( seq 1 60) ; do
7- curl $base_url /feedback/how-are-you-feeling && break || true
7+ curl $base_url /feedback/thumbs && break || true
88 sleep 1
99done
1010
1111check_summary () {
12- len=$( curl -s $base_url /feedback/how-are-you-feeling /answer | jq ' length' )
12+ len=$( curl -s $base_url /feedback/thumbs /answer | jq ' length' )
1313 test " $len " -eq $1
1414
15- positive=$( curl -s $base_url /feedback/how-are-you-feeling /summary | jq .' values."1"' )
15+ positive=$( curl -s $base_url /feedback/thumbs /summary | jq .' values."1"' )
1616 test " $positive " -eq $2
17- negative=$( curl -s $base_url /feedback/how-are-you-feeling /summary | jq .' values."-1"' )
17+ negative=$( curl -s $base_url /feedback/thumbs /summary | jq .' values."-1"' )
1818 test " $negative " -eq $3
19- empty=$( curl -s $base_url /feedback/how-are-you-feeling /summary | jq .' values.""' )
19+ empty=$( curl -s $base_url /feedback/thumbs /summary | jq .' values.""' )
2020 test " $empty " -eq $4
2121}
2222
23- len=$( curl -s $base_url /feedback/how-are-you-feeling /answer | jq ' length' )
23+ len=$( curl -s $base_url /feedback/thumbs /answer | jq ' length' )
2424test " $len " -eq 0
2525
2626feedback=" 1
2727-1
28281"
2929
3030for i in $feedback ; do
31- curl -s -X POST -H " Content-Type: application/json" -d " {\" value\" :$i , \" submit\" : true}" $base_url /feedback/how-are-you-feeling /answer
31+ curl -s -X POST -H " Content-Type: application/json" -d " {\" value\" :$i , \" submit\" : true}" $base_url /feedback/thumbs /answer
3232done ;
3333
34- last=$( curl -s -X POST -H " Content-Type: application/json" -d " {\" value\" : -1}" $base_url /feedback/how-are-you-feeling /answer | jq .id -r)
34+ last=$( curl -s -X POST -H " Content-Type: application/json" -d " {\" value\" : -1}" $base_url /feedback/thumbs /answer | jq .id -r)
3535
3636check_summary 4 2 2 0
3737
38- curl -s -X PATCH -H " Content-Type: application/json" -d " {\" value\" : 1, \" submit\" : true}" $base_url /feedback/how-are-you-feeling /answer/$last
39- curl -s -X POST -H " Content-Type: application/json" -d " {}" $base_url /feedback/how-are-you-feeling /answer
38+ curl -s -X PATCH -H " Content-Type: application/json" -d " {\" value\" : 1, \" submit\" : true}" $base_url /feedback/thumbs /answer/$last
39+ curl -s -X POST -H " Content-Type: application/json" -d " {}" $base_url /feedback/thumbs /answer
4040
4141check_summary 5 3 1 1
0 commit comments