Emi Matchu
5b1d1f0695
I forget, there was some tricky debugging about getting the fixtures right, I think the previous commit doesn't *actually* pass from a clean setting. Ah well, looks good now!
16 lines
482 B
Ruby
16 lines
482 B
Ruby
# We replace Neopets::CustomPets methods with a mocked implementation.
|
|
module Neopets::CustomPets
|
|
def self.fetch_viewer_data(pet_name, ...)
|
|
File.open(Rails.root / "spec/mocks/custom_pets/#{pet_name}.json") do |file|
|
|
HashWithIndifferentAccess.new JSON.load(file)
|
|
end
|
|
end
|
|
|
|
def self.fetch_metadata(...)
|
|
raise NotImplementedError
|
|
end
|
|
|
|
def self.fetch_image_hash(pet_name, ...)
|
|
"m:#{pet_name}"[0, 8] # A mock hash, like `m:thyass` for "thyassa".
|
|
end
|
|
end
|