diff options
| author | Omar Roth <omarroth@protonmail.com> | 2020-03-30 14:23:51 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@protonmail.com> | 2020-03-30 14:23:51 -0500 |
| commit | 80fc60b5e2d0d2c421b7993495398272c751ec3b (patch) | |
| tree | 6cc340d0ee9bf8c8c96b4cf1b9251ac5b3109666 | |
| parent | 3b2e142542cf051c89b7a6b678463b0693489b91 (diff) | |
| download | invidious-80fc60b5e2d0d2c421b7993495398272c751ec3b.tar.gz invidious-80fc60b5e2d0d2c421b7993495398272c751ec3b.tar.bz2 invidious-80fc60b5e2d0d2c421b7993495398272c751ec3b.zip | |
Add spec for extract_plid
| -rw-r--r-- | spec/helpers_spec.cr | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/helpers_spec.cr b/spec/helpers_spec.cr index 95222e0b..37e36c61 100644 --- a/spec/helpers_spec.cr +++ b/spec/helpers_spec.cr @@ -9,6 +9,7 @@ require "../src/invidious/channels" require "../src/invidious/comments" require "../src/invidious/playlists" require "../src/invidious/search" +require "../src/invidious/trending" require "../src/invidious/users" describe "Helper" do @@ -124,6 +125,15 @@ describe "Helper" do end end + describe "#extract_plid" do + it "correctly extracts playlist ID from trending URL" do + extract_plid("/feed/trending?bp=4gIuCggvbS8wNHJsZhIiUExGZ3F1TG5MNTlhbVBud2pLbmNhZUp3MDYzZlU1M3Q0cA%3D%3D").should eq("PLFgquLnL59amPnwjKncaeJw063fU53t4p") + extract_plid("/feed/trending?bp=4gIvCgkvbS8wYnp2bTISIlBMaUN2Vkp6QnVwS2tDaFNnUDdGWFhDclo2aEp4NmtlTm0%3D").should eq("PLiCvVJzBupKkChSgP7FXXCrZ6hJx6keNm") + extract_plid("/feed/trending?bp=4gIuCggvbS8wNWpoZxIiUEwzWlE1Q3BOdWxRbUtPUDNJekdsYWN0V1c4dklYX0hFUA%3D%3D").should eq("PL3ZQ5CpNulQmKOP3IzGlactWW8vIX_HEP") + extract_plid("/feed/trending?bp=4gIuCggvbS8wMnZ4bhIiUEx6akZiYUZ6c21NUnFhdEJnVTdPeGNGTkZhQ2hqTkVERA%3D%3D").should eq("PLzjFbaFzsmMRqatBgU7OxcFNFaChjNEDD") + end + end + describe "#sign_token" do it "correctly signs a given hash" do token = { |
