diff --git a/spec/models/order_item_spec.rb b/spec/models/order_item_spec.rb index 02c7049..200fc17 100644 --- a/spec/models/order_item_spec.rb +++ b/spec/models/order_item_spec.rb @@ -9,6 +9,10 @@ # describe OrderItem do + before(:each) do + stub_request(:get, /.*/).to_return(status: 200, body: JSON.dump({ balance: 20 })) + end + it 'has a valid factory' do order_item = create :order_item expect(order_item).to be_valid diff --git a/spec/models/order_spec.rb b/spec/models/order_spec.rb index a11d064..07e1802 100644 --- a/spec/models/order_spec.rb +++ b/spec/models/order_spec.rb @@ -12,6 +12,7 @@ describe Order do before :each do + stub_request(:get, /.*/).to_return(status: 200, body: JSON.dump({ balance: 20 })) @user = create :user @order = create :order, user: @user end