There is a missing RSpec test for PerseveranceScraper. Add the missing test in /spec/models/perseverance_scraper_spec.rb
Write a test that triggers line 48 of app/models/perseverance_scraper.rb: puts "WARNING: Camera not found. Name: #{camera}"
You can do this by passing the method an image json with a camera name that does not exist .
def create_photo(image)
sol = image['sol']
camera = camera_from_json image
link = image['image_files']['large']
if camera.is_a?(String)
puts "WARNING: Camera not found. Name: #{camera}"
else
photo = Photo.find_or_initialize_by(sol: sol, camera: camera,
img_src: link, rover: rover)
photo.log_and_save_if_new
end
end
There is a missing RSpec test for
PerseveranceScraper
. Add the missing test in/spec/models/perseverance_scraper_spec.rb
Write a test that triggers line 48 of
app/models/perseverance_scraper.rb
:puts "WARNING: Camera not found. Name: #{camera}"
You can do this by passing the method an image json with a camera name that does not exist .