diff --git a/spec/lago/api/resources/payment_request_spec.rb b/spec/lago/api/resources/payment_request_spec.rb index 536a17ff..9d6528b5 100644 --- a/spec/lago/api/resources/payment_request_spec.rb +++ b/spec/lago/api/resources/payment_request_spec.rb @@ -96,6 +96,20 @@ end end + context 'when currency is given' do + before do + stub_request(:get, 'https://api.getlago.com/api/v1/payment_requests?currency=EUR') + .to_return(body: payment_requests_response, status: 200) + end + + it 'forwards the currency option as a query param' do + resource.get_all({ currency: 'EUR' }) + + expect(WebMock).to have_requested(:get, 'https://api.getlago.com/api/v1/payment_requests') + .with(query: { currency: 'EUR' }) + end + end + context 'when there is an issue' do before do stub_request(:get, 'https://api.getlago.com/api/v1/payment_requests') diff --git a/spec/lago/api/resources/subscription_spec.rb b/spec/lago/api/resources/subscription_spec.rb index 28cf5de7..27e1b4c8 100644 --- a/spec/lago/api/resources/subscription_spec.rb +++ b/spec/lago/api/resources/subscription_spec.rb @@ -417,6 +417,20 @@ end end + context 'when currency is given' do + before do + stub_request(:get, 'https://api.getlago.com/api/v1/subscriptions?currency=EUR') + .to_return(body: response, status: 200) + end + + it 'forwards the currency option as a query param' do + resource.get_all({ currency: 'EUR' }) + + expect(WebMock).to have_requested(:get, 'https://api.getlago.com/api/v1/subscriptions') + .with(query: { currency: 'EUR' }) + end + end + context 'when status is given' do before do stub_request(:get, 'https://api.getlago.com/api/v1/subscriptions?external_customer_id=123&status%5B%5D=pending') diff --git a/spec/lago/api/resources/wallet_spec.rb b/spec/lago/api/resources/wallet_spec.rb index 734d4bd8..9fcd4ceb 100644 --- a/spec/lago/api/resources/wallet_spec.rb +++ b/spec/lago/api/resources/wallet_spec.rb @@ -675,6 +675,20 @@ end end + context 'when currency is given' do + before do + stub_request(:get, 'https://api.getlago.com/api/v1/wallets?currency=EUR') + .to_return(body: response, status: 200) + end + + it 'forwards the currency option as a query param' do + resource.get_all({ currency: 'EUR' }) + + expect(WebMock).to have_requested(:get, 'https://api.getlago.com/api/v1/wallets') + .with(query: { currency: 'EUR' }) + end + end + context 'when there is an issue' do before do stub_request(:get, 'https://api.getlago.com/api/v1/wallets')