mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-24 14:47:23 +00:00
37 lines
1.0 KiB
HTTP
37 lines
1.0 KiB
HTTP
### Spotify Initial Registration Flow
|
|
|
|
# @name Init Spotify Flow
|
|
POST {{host}}/mgmt/spotify/init
|
|
Authorization: Basic admin change_me!
|
|
|
|
> {%
|
|
client.global.set("redirectUrl", response.body.redirectUrl);
|
|
%}
|
|
|
|
###
|
|
|
|
# @name Spotify Callback
|
|
# Simulates the user being redirected back from Spotify with a code
|
|
GET {{host}}/mgmt/spotify/callback?code=mock-auth-code
|
|
|
|
###
|
|
|
|
# @name Verify Accounts
|
|
GET {{host}}/mgmt/spotify/accounts
|
|
Authorization: Basic admin change_me!
|
|
|
|
> {%
|
|
client.test("Account exists", function() {
|
|
client.assert(response.body.accounts.length > 0, "No accounts found");
|
|
var found = false;
|
|
for (var i = 0; i < response.body.accounts.length; i++) {
|
|
if (response.body.accounts[i].user_id === "spotify-user-id") {
|
|
found = true;
|
|
client.assert(response.body.accounts[i].display_name === "Spotify Test User", "Display name mismatch");
|
|
break;
|
|
}
|
|
}
|
|
client.assert(found, "Account 'spotify-user-id' not found in " + JSON.stringify(response.body.accounts));
|
|
});
|
|
%}
|