@@ -33,6 +33,34 @@ def test_typeahead_with_mock
3333 assert response [ 'terms' ] . length > 0
3434 end
3535
36+ def test_spellcheck_with_mock
37+ term = 'test123'
38+ client = PodcastApi ::Client . new
39+ response = client . spellcheck ( q : term )
40+ assert_equal response . request . options [ :query ] [ :q ] , term
41+ assert_equal response . request . http_method , Net ::HTTP ::Get
42+ assert_equal response . request . path . path , '/api/v2/spellcheck'
43+ assert response [ 'tokens' ] . length > 0
44+ end
45+
46+ def test_related_searches_with_mock
47+ term = 'test123'
48+ client = PodcastApi ::Client . new
49+ response = client . fetch_related_searches ( q : term )
50+ assert_equal response . request . options [ :query ] [ :q ] , term
51+ assert_equal response . request . http_method , Net ::HTTP ::Get
52+ assert_equal response . request . path . path , '/api/v2/related_searches'
53+ assert response [ 'terms' ] . length > 0
54+ end
55+
56+ def test_trending_searches_with_mock
57+ client = PodcastApi ::Client . new
58+ response = client . fetch_trending_searches ( )
59+ assert_equal response . request . http_method , Net ::HTTP ::Get
60+ assert_equal response . request . path . path , '/api/v2/trending_searches'
61+ assert response [ 'terms' ] . length > 0
62+ end
63+
3664 def test_fetch_best_podcasts_with_mock
3765 genre_id = 123
3866 client = PodcastApi ::Client . new
0 commit comments