GitLab's annual major release is around the corner. Along with a lot of new and exciting features, there will be a few breaking changes. Learn more here.

Commit df724b8f authored by Francis's avatar Francis
Browse files

Data achievements endpoint

parent fe7532e0
......@@ -21,11 +21,15 @@ module BlizzardApi
#
# @!macro response
def get(id, options = {})
return super options unless options.include? :use_community_endpoint
return super id, options unless options.include? :use_community_endpoint
api_request "#{base_url(:community)}/achievement/#{id}", { ttl: CACHE_TRIMESTER }.merge(options)
end
def complete(options = {})
raise BlizzardApi::ApiException, 'There are too many achievements to fetch complete data'
end
##
# Return a list of possible character achievements.
# This endpoint uses a community endpoint. It is recommended to use the new data endpoint using {#index}.
......
......@@ -8,7 +8,7 @@ module BlizzardApi
def test_achievement_index
achievement = BlizzardApi::Wow::Achievement.new
achievement_data = achievement.index
assert_equal 4874, achievement_data[:achievements].count
assert_equal 4875, achievement_data[:achievements].count
end
def test_achievement_get
......@@ -33,7 +33,7 @@ module BlizzardApi
end
def test_achievement_complete
assert_raise BlizzardApi::ApiException do
assert_raises BlizzardApi::ApiException do
achievement = BlizzardApi::Wow::Achievement.new
achievement.complete
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment