@@ -245,6 +245,10 @@ fn test_get_watching_returns_movie() {
245245
246246 let mock = server
247247 . mock ( "GET" , "/users/testuser/watching" )
248+ . match_query ( mockito:: Matcher :: UrlEncoded (
249+ "extended" . into ( ) ,
250+ "full" . into ( ) ,
251+ ) )
248252 . match_header ( "trakt-api-version" , "2" )
249253 . match_header ( "trakt-api-key" , "test_client" )
250254 . with_status ( 200 )
@@ -277,6 +281,10 @@ fn test_get_watching_returns_episode() {
277281
278282 let mock = server
279283 . mock ( "GET" , "/users/testuser/watching" )
284+ . match_query ( mockito:: Matcher :: UrlEncoded (
285+ "extended" . into ( ) ,
286+ "full" . into ( ) ,
287+ ) )
280288 . match_header ( "trakt-api-version" , "2" )
281289 . with_status ( 200 )
282290 . with_header ( "content-type" , "application/json" )
@@ -309,6 +317,10 @@ fn test_get_watching_returns_none_when_not_watching() {
309317
310318 let mock = server
311319 . mock ( "GET" , "/users/testuser/watching" )
320+ . match_query ( mockito:: Matcher :: UrlEncoded (
321+ "extended" . into ( ) ,
322+ "full" . into ( ) ,
323+ ) )
312324 . with_status ( 204 ) // No Content
313325 . create ( ) ;
314326
@@ -333,6 +345,10 @@ fn test_get_watching_handles_401() {
333345
334346 let mock = server
335347 . mock ( "GET" , "/users/testuser/watching" )
348+ . match_query ( mockito:: Matcher :: UrlEncoded (
349+ "extended" . into ( ) ,
350+ "full" . into ( ) ,
351+ ) )
336352 . with_status ( 401 )
337353 . create ( ) ;
338354
@@ -357,6 +373,10 @@ fn test_get_watching_handles_403() {
357373
358374 let mock = server
359375 . mock ( "GET" , "/users/testuser/watching" )
376+ . match_query ( mockito:: Matcher :: UrlEncoded (
377+ "extended" . into ( ) ,
378+ "full" . into ( ) ,
379+ ) )
360380 . with_status ( 403 )
361381 . create ( ) ;
362382
@@ -382,6 +402,10 @@ fn test_get_watching_with_oauth_uses_me_endpoint() {
382402 // When OAuth token is present, should use /users/me/watching instead of /users/{username}/watching
383403 let mock = server
384404 . mock ( "GET" , "/users/me/watching" )
405+ . match_query ( mockito:: Matcher :: UrlEncoded (
406+ "extended" . into ( ) ,
407+ "full" . into ( ) ,
408+ ) )
385409 . match_header ( "Authorization" , "Bearer my_oauth_token" )
386410 . with_status ( 200 )
387411 . with_body ( common:: fixtures:: TRAKT_MOVIE_WATCHING )
@@ -409,6 +433,10 @@ fn test_get_watching_encodes_special_chars_in_username() {
409433 // Username with spaces should be URL-encoded when no OAuth token is present
410434 let mock = server
411435 . mock ( "GET" , "/users/john%20doe/watching" )
436+ . match_query ( mockito:: Matcher :: UrlEncoded (
437+ "extended" . into ( ) ,
438+ "full" . into ( ) ,
439+ ) )
412440 . with_status ( 200 )
413441 . with_body ( common:: fixtures:: TRAKT_MOVIE_WATCHING )
414442 . create ( ) ;
@@ -435,6 +463,10 @@ fn test_get_watching_empty_oauth_uses_username_endpoint() {
435463 // Empty OAuth token should fall back to /users/{username}/watching
436464 let mock = server
437465 . mock ( "GET" , "/users/testuser/watching" )
466+ . match_query ( mockito:: Matcher :: UrlEncoded (
467+ "extended" . into ( ) ,
468+ "full" . into ( ) ,
469+ ) )
438470 . with_status ( 200 )
439471 . with_body ( common:: fixtures:: TRAKT_MOVIE_WATCHING )
440472 . create ( ) ;
@@ -1076,18 +1108,30 @@ fn test_get_watching_retries_on_503() {
10761108 // First two calls return 503, third call succeeds
10771109 let mock_503_first = server
10781110 . mock ( "GET" , "/users/testuser/watching" )
1111+ . match_query ( mockito:: Matcher :: UrlEncoded (
1112+ "extended" . into ( ) ,
1113+ "full" . into ( ) ,
1114+ ) )
10791115 . with_status ( 503 )
10801116 . expect ( 1 )
10811117 . create ( ) ;
10821118
10831119 let mock_503_second = server
10841120 . mock ( "GET" , "/users/testuser/watching" )
1121+ . match_query ( mockito:: Matcher :: UrlEncoded (
1122+ "extended" . into ( ) ,
1123+ "full" . into ( ) ,
1124+ ) )
10851125 . with_status ( 503 )
10861126 . expect ( 1 )
10871127 . create ( ) ;
10881128
10891129 let mock_success = server
10901130 . mock ( "GET" , "/users/testuser/watching" )
1131+ . match_query ( mockito:: Matcher :: UrlEncoded (
1132+ "extended" . into ( ) ,
1133+ "full" . into ( ) ,
1134+ ) )
10911135 . with_status ( 200 )
10921136 . with_header ( "content-type" , "application/json" )
10931137 . with_body ( common:: fixtures:: TRAKT_MOVIE_WATCHING )
@@ -1127,18 +1171,30 @@ fn test_get_watching_retries_on_429() {
11271171 // First two calls return 429 (rate limited), third call succeeds
11281172 let mock_429_first = server
11291173 . mock ( "GET" , "/users/testuser/watching" )
1174+ . match_query ( mockito:: Matcher :: UrlEncoded (
1175+ "extended" . into ( ) ,
1176+ "full" . into ( ) ,
1177+ ) )
11301178 . with_status ( 429 )
11311179 . expect ( 1 )
11321180 . create ( ) ;
11331181
11341182 let mock_429_second = server
11351183 . mock ( "GET" , "/users/testuser/watching" )
1184+ . match_query ( mockito:: Matcher :: UrlEncoded (
1185+ "extended" . into ( ) ,
1186+ "full" . into ( ) ,
1187+ ) )
11361188 . with_status ( 429 )
11371189 . expect ( 1 )
11381190 . create ( ) ;
11391191
11401192 let mock_success = server
11411193 . mock ( "GET" , "/users/testuser/watching" )
1194+ . match_query ( mockito:: Matcher :: UrlEncoded (
1195+ "extended" . into ( ) ,
1196+ "full" . into ( ) ,
1197+ ) )
11421198 . with_status ( 200 )
11431199 . with_header ( "content-type" , "application/json" )
11441200 . with_body ( common:: fixtures:: TRAKT_EPISODE_WATCHING )
@@ -1176,6 +1232,10 @@ fn test_get_watching_gives_up_after_max_retries() {
11761232 // Server always returns 503 - should hit max_retries + 1 times (initial + retries)
11771233 let mock_503 = server
11781234 . mock ( "GET" , "/users/testuser/watching" )
1235+ . match_query ( mockito:: Matcher :: UrlEncoded (
1236+ "extended" . into ( ) ,
1237+ "full" . into ( ) ,
1238+ ) )
11791239 . with_status ( 503 )
11801240 . expect ( 4 ) // 1 initial + 3 retries = 4 total attempts
11811241 . create ( ) ;
0 commit comments