Skip to content

Commit

Permalink
httpclient: include a uri modifying filter in spec tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbnz committed Feb 14, 2024
1 parent 65ba375 commit 96726c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spec/acceptance/httpclient/httpclient_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
class Filter
def filter_request(request)
request.header["Authorization"] = "Bearer 0123456789"
request.header.request_uri.query = "webmock=here"
end

def filter_response(request, response)
Expand All @@ -112,7 +113,9 @@ def filter_response(request, response)
before do
@client = HTTPClient.new
@client.request_filter << Filter.new
stub_request(:get, 'www.example.com').with(headers: {'Authorization' => 'Bearer 0123456789'})
stub_request(:get, 'www.example.com').with(
query: {'webmock' => 'here'},
headers: {'Authorization' => 'Bearer 0123456789'})
end

it "supports request filters" do
Expand Down

0 comments on commit 96726c0

Please sign in to comment.