fixes #2805: Improve nico seiga support

This commit is contained in:
Albert Yi
2016-12-27 16:09:20 -08:00
parent 08e0480a62
commit 3ad639521f
4 changed files with 376 additions and 11 deletions

View File

@@ -1,6 +1,12 @@
require 'test_helper'
class ArtistUrlTest < ActiveSupport::TestCase
def setup
super
@record = false
setup_vcr
end
context "An artist url" do
setup do
MEMCACHE.flush_all
@@ -40,8 +46,13 @@ class ArtistUrlTest < ActiveSupport::TestCase
end
should "normalize nico seiga artist urls" do
url = FactoryGirl.create(:artist_url, :url => "http://seiga.nicovideo.jp/user/illust/1826959?target=illust_all")
assert_equal("http://seiga.nicovideo.jp/user/illust/1826959/", url.normalized_url)
url = FactoryGirl.create(:artist_url, :url => "http://seiga.nicovideo.jp/user/illust/1826959")
assert_equal("http://seiga.nicovideo.jp/user/illust/1826959", url.normalized_url)
VCR.use_cassette("artist-url-test/nico-seiga", :record => @vcr_record_option) do
url = FactoryGirl.create(:artist_url, :url => "http://seiga.nicovideo.jp/seiga/im4937663")
assert_equal("http://seiga.nicovideo.jp/user/illust/7017777/", url.normalized_url)
end
end
should "normalize hentai foundry artist urls" do