Mastodon: rewrite tests

This commit is contained in:
nonamethanks
2022-10-08 15:55:06 +02:00
parent da46b13a64
commit f4b14ba23e
3 changed files with 72 additions and 114 deletions

View File

@@ -15,7 +15,7 @@ class MastodonApiClient
def json
return {} if id.blank? || access_token.blank?
JSON.parse(access_token.get("/api/v1/statuses/#{id}").body)
rescue
rescue JSON::ParserError
{}
end

View File

@@ -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