From 21eaf7b266c162d4a4ead8558126fe220e0695e0 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Tue, 19 Nov 2024 13:32:47 -0800 Subject: [PATCH] Fix silly variable scoping issue in item spec Oh right, `@remote_id` is an instance variable so we can auto-increment it over time, but `url` is just a derived value, and can just be local! Silly! --- spec/models/item_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/models/item_spec.rb b/spec/models/item_spec.rb index 55cb087e..d0291d40 100644 --- a/spec/models/item_spec.rb +++ b/spec/models/item_spec.rb @@ -31,8 +31,8 @@ RSpec.describe Item do def build_item_asset(zone, body_id:) @remote_id = (@remote_id || 0) + 1 - @url = "https://images.neopets.example/#{@remote_id}.swf" - SwfAsset.new(type: "object", remote_id: @remote_id, url: @url, + url = "https://images.neopets.example/#{@remote_id}.swf" + SwfAsset.new(type: "object", remote_id: @remote_id, url:, zones_restrict: "", zone:, body_id:) end