Mock HTTP requests to Tab

This commit is contained in:
redfast00 2018-12-30 19:50:59 +01:00
parent c6ef077f7e
commit 05c83fb5cc
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C
2 changed files with 5 additions and 0 deletions

View file

@ -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

View file

@ -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