Merge pull request #5285 from nonamethanks/tests
Rewrite the tests for various source strategies
This commit is contained in:
@@ -48,7 +48,7 @@ class Source::Extractor
|
||||
|
||||
def tags
|
||||
api_response[:tags].to_a.map do |tag|
|
||||
[tag, "https://www.artstation.com/search?q=" + CGI.escape(tag)]
|
||||
[tag, "https://www.artstation.com/search?q=#{CGI.escape(tag)}"]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -94,7 +94,7 @@ class Source::Extractor
|
||||
image_sizes = %w[original 4k large medium small]
|
||||
urls = image_sizes.map { |size| parsed_url.full_image_url(size) }
|
||||
|
||||
chosen_url = urls.find { |url| http_exists?(url) }
|
||||
chosen_url = urls.find { |u| http_exists?(u) }
|
||||
chosen_url || url
|
||||
end
|
||||
end
|
||||
|
||||
@@ -52,7 +52,7 @@ class Source::Extractor
|
||||
end
|
||||
|
||||
def artist_name
|
||||
api_response.account_name
|
||||
api_response.account_name || artist_name_from_url
|
||||
end
|
||||
|
||||
def artist_name_from_url
|
||||
@@ -60,7 +60,7 @@ class Source::Extractor
|
||||
end
|
||||
|
||||
def other_names
|
||||
[api_response.display_name]
|
||||
[api_response.display_name].compact
|
||||
end
|
||||
|
||||
def account_id
|
||||
|
||||
Reference in New Issue
Block a user