From 05c83fb5ccccd3aef2e2f95904195eb974966456 Mon Sep 17 00:00:00 2001 From: redfast00 Date: Sun, 30 Dec 2018 19:50:59 +0100 Subject: [PATCH] Mock HTTP requests to Tab --- spec/models/order_item_spec.rb | 4 ++++ spec/models/order_spec.rb | 1 + 2 files changed, 5 insertions(+) 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