diff --git a/test/unit/sources/art_station_test.rb b/test/unit/sources/art_station_test.rb index f0dec1b7b..a8b7afd9b 100644 --- a/test/unit/sources/art_station_test.rb +++ b/test/unit/sources/art_station_test.rb @@ -11,6 +11,10 @@ module Sources assert_equal("https://cdn.artstation.com/p/assets/images/images/000/705/368/4k/jey-rain-one1.jpg", @site.image_url.sub(/\?\d+/, "")) end + should "get the preview url" do + assert_equal("https://cdn.artstation.com/p/assets/images/images/000/705/368/small/jey-rain-one1.jpg", @site.preview_url.sub(/\?\d+/, "")) + end + should "get the canonical url" do assert_equal("https://jeyrain.artstation.com/projects/04XA4", @site.canonical_url) end @@ -43,6 +47,11 @@ module Sources assert_equal(url, @site.image_url) end + should "get the preview url" do + url = "https://cdn.artstation.com/p/assets/images/images/006/066/534/small/yinan-cui-reika.jpg?1495781565" + assert_equal(url, @site.preview_url) + end + should "get the canonical url" do assert_equal("https://dantewontdie.artstation.com/projects/YZK5q", @site.canonical_url) end @@ -76,6 +85,11 @@ module Sources assert_equal(url, @site.image_url) end + should "get the preview url" do + url = "https://cdn.artstation.com/p/assets/images/images/000/144/922/small/cassio-yoshiyaki-cody2backup2-yoshiyaki.jpg?1406314198" + assert_equal(url, @site.preview_url) + end + should "get the tags" do assert_equal(["Street Fighter", "Cody", "SF"].sort, @site.tags.map(&:first).sort) assert_equal(["street_fighter", "cody", "sf"].sort, @site.normalized_tags.sort) @@ -126,6 +140,16 @@ module Sources end end + context "A cover url" do + should "work" do + url = "https://cdna.artstation.com/p/assets/covers/images/007/262/828/large/monica-kyrie-1.jpg?1504865060" + site = Sources::Strategies.find(url) + + assert_equal("https://cdn.artstation.com/p/assets/covers/images/007/262/828/original/monica-kyrie-1.jpg?1504865060", site.image_url) + assert_equal("https://cdn.artstation.com/p/assets/covers/images/007/262/828/small/monica-kyrie-1.jpg?1504865060", site.preview_url) + end + end + context "The source site for an ArtStation gallery" do setup do @site = Sources::Strategies.find("https://www.artstation.com/artwork/BDxrA")