Fix trade activity tests: use a valid item fixture, not a placeholder

In 540ce08caa, I updated the Item class
to be more explicit about what fields are required, so this test would
fail in a more helpful way, instead of just crashing from `name` being
`nil` when trying to infer the Dyeworks info.

Now, we update the test to use Rails's standard "fixture" system to set
up a more-correct placeholder item, instead!
This commit is contained in:
Emi Matchu 2024-10-21 14:26:36 -07:00
parent 540ce08caa
commit 9726ecb1a5
2 changed files with 14 additions and 6 deletions

14
test/fixtures/items.yml vendored Normal file
View file

@ -0,0 +1,14 @@
straw_hat:
id: 58
name: Straw Hat
description: "This straw hat will keep the sun out of your pets eyes in
bright sunlight."
thumbnail_url: https://images.neopets.com/items/straw-hat.gif
type: Clothes
category: Clothes
rarity: Very Rare
rarity_index: 90
price: 376
weight_lbs: 1
zones_restrict: 0000000000000000000000000001000000001010000000000000
species_support_ids: "35"

View file

@ -203,12 +203,6 @@ class TradeActivityTest < ActiveSupport::TestCase
setup do setup do
freeze_time # to compare timestamps accurately freeze_time # to compare timestamps accurately
Item.create!(
thumbnail_url: "https://images.neopets.com/foo.png",
zones_restrict: "",
price: 123,
)
end end
private private