impress/spec/mocks/custom_pets.rb
Emi Matchu e92e315743 Move modeling tests to RSpec
Also note the jsbundling bump, that was so I can us the relatively-new
`SKIP_YARN_INSTALL=1` flag when running tests, to be a bit faster.
2024-10-21 16:03:58 -07:00

16 lines
444 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, ...)
"mock-image-hash:#{pet_name}"
end
end