fix unit tests

This commit is contained in:
r888888888
2017-11-20 16:10:35 -08:00
parent f11992bd91
commit 502f1298a9
25 changed files with 101 additions and 29 deletions

View File

@@ -12,12 +12,32 @@ class PawooApiClient
end
def initialize(json)
@json = get
@json = json
end
def profile_url
json["url"]
end
def account_name
json["username"]
end
def image_url
nil
end
def image_urls
[]
end
def tags
[]
end
def commentary
nil
end
end
class Status
@@ -32,7 +52,7 @@ class PawooApiClient
@json = json
end
def account_profile_url
def profile_url
json["account"]["url"]
end
@@ -60,9 +80,11 @@ class PawooApiClient
end
end
def get_status(url)
def get(url)
if id = Status.is_match?(url)
Status.new(JSON.parse(access_token.get("/api/v1/statuses/#{id}").body))
elsif id = Account.is_match?(url)
Account.new(JSON.parse(access_token.get("/api/v1/accounts/#{id}").body))
else
nil
end