tests: fix broken tests.

This commit is contained in:
evazion
2022-03-15 04:45:30 -05:00
parent 133c45ee29
commit 644dfaf74c
5 changed files with 11 additions and 7 deletions

View File

@@ -40,7 +40,7 @@ module Sources
end
def profile_url
"https://seiga.nicovideo.jp/user/illust/#{api_client.user_id}" if api_client.user_id.present?
"https://seiga.nicovideo.jp/user/illust/#{api_client.user_id}" if api_client&.user_id.present?
end
def artist_name

View File

@@ -15,6 +15,10 @@ module Sources
url
end
def artists
ArtistFinder.find_artists(url)
end
def normalize_for_source
case url
when %r{\Ahttp://www\.karabako\.net/images(?:ub)?/karabako_(\d+)(?:_\d+)?\.}i

View File

@@ -30,7 +30,7 @@ module Sources::Strategies
def image_urls
# https://pbs.twimg.com/media/EBGbJe_U8AA4Ekb.jpg:orig
if parsed_url.image_url?
[parsed_url.orig_image_url]
[parsed_url.full_image_url]
elsif api_response.present?
api_response.dig(:extended_entities, :media).to_a.map do |media|
if media[:type] == "photo"
@@ -43,7 +43,7 @@ module Sources::Strategies
end
end
else
[url]
[]
end
end