Skip to content

Commit

Permalink
Fix failing API promotions specs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MadelineCollier committed Sep 23, 2024
1 parent 72920b8 commit f7cea4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/spec/requests/spree/api/promotions_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'spec_helper'
require 'ostruct'

module Spree::Api
describe 'Promotions', type: :request do
Expand All @@ -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',
Expand Down

0 comments on commit f7cea4b

Please sign in to comment.