From e85a26c4830758eea4d22688d91eb7e372500a1a Mon Sep 17 00:00:00 2001 From: Bnyro Date: Mon, 30 Jan 2023 16:16:07 +0100 Subject: [PATCH] Add test for importing subscriptions --- testing/api-test.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/testing/api-test.sh b/testing/api-test.sh index 77c2e59..8ac0faa 100755 --- a/testing/api-test.sh +++ b/testing/api-test.sh @@ -96,6 +96,10 @@ curl ${CURLOPTS[@]} $HOST/unsubscribe -X POST -H "Content-Type: application/json # Resubscribe to the Channel curl ${CURLOPTS[@]} $HOST/subscribe -X POST -H "Content-Type: application/json" -H "Authorization: $AUTH_TOKEN" -d $(jq -n --compact-output --arg channelId "UCfdNM3NAhaBOXCafH7krzrA" '{"channelId": $channelId}') || exit 1 +# Import subscriptions Test +CHANNEL_IDS='[UCsXVk37bltHxD1rDPwtNM8Q,UCXuqSBlHAE6Xw-yeJA0Tunw]' +curl ${CURLOPTS[@]} $HOST/import -X POST -H "Content-Type: application/json" -H "Authorization: $AUTH_TOKEN" -d "$CHANNEL_IDS" || exit 1 + # Wait 2s to allow the subscription request to be processed sleep 2 @@ -146,5 +150,5 @@ curl ${CURLOPTS[@]} $HOST/subscriptions/unauthenticated -G --data-urlencode "cha # Unauthenticated subscription tests POST CHANNEL_IDS='[UCsXVk37bltHxD1rDPwtNM8Q,UCXuqSBlHAE6Xw-yeJA0Tunw]' -curl ${CURLOPTS[@]} $HOST/feed/unauthenticated -X POST -d "$CHANNEL_IDS" || exit 1 -curl ${CURLOPTS[@]} $HOST/subscriptions/unauthenticated -X POST -d "$CHANNEL_IDS" || exit 1 \ No newline at end of file +curl ${CURLOPTS[@]} $HOST/feed/unauthenticated -X POST -H "Content-Type: application/json" -d "$CHANNEL_IDS" || exit 1 +curl ${CURLOPTS[@]} $HOST/subscriptions/unauthenticated -X POST -H "Content-Type: application/json" -d "$CHANNEL_IDS" || exit 1 \ No newline at end of file