From f7cea4be66815829e0152f5f3545253f6542f3f9 Mon Sep 17 00:00:00 2001 From: Madeline Collier Date: Mon, 23 Sep 2024 13:20:00 +0200 Subject: [PATCH] Fix failing API promotions specs Three of these examples were failing with the following error: NameError: uninitialized constant Spree::Api::OpenStruct OpenStruct.new( ^^^^^^^^^^ Requiring ostruct and ensuring the correct scope is used when referencing OpenStruct fixes the errors. --- api/spec/requests/spree/api/promotions_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/spec/requests/spree/api/promotions_spec.rb b/api/spec/requests/spree/api/promotions_spec.rb index 7ab350e779..b6b16f0a92 100644 --- a/api/spec/requests/spree/api/promotions_spec.rb +++ b/api/spec/requests/spree/api/promotions_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'spec_helper' +require 'ostruct' module Spree::Api describe 'Promotions', type: :request do @@ -25,7 +26,7 @@ module Spree::Api end let(:found_promotion) do - OpenStruct.new( + ::OpenStruct.new( id: 1, name: 'Test Promotion', description: 'Promotion for testing purposes',