From e81a52d8c4534e47a6969da260593d436a3706f8 Mon Sep 17 00:00:00 2001 From: manu vasconcelos Date: Wed, 24 Jan 2024 12:19:28 -0300 Subject: [PATCH] test query for failing test / stub request --- test/models/parser/twitter_profile_test.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/models/parser/twitter_profile_test.rb b/test/models/parser/twitter_profile_test.rb index a5422f68..6ff2cde0 100644 --- a/test/models/parser/twitter_profile_test.rb +++ b/test/models/parser/twitter_profile_test.rb @@ -90,11 +90,10 @@ def stub_profile_lookup test "it makes a get request to the user lookup by username endpoint successfully" do stub_configs({'twitter_bearer_token' => 'test' }) - - WebMock.stub_request(:get, "https://api.twitter.com/2/users/by") - .with(query: query) - .with(headers: { - "Authorization": "Bearer test", + + WebMock.stub_request(:get, "https://api.twitter.com/2/users/by?user.fields=profile_image_url,name,username,description,created_at,url&usernames=fake_user") + .with(headers: { + "Authorization": "Bearer test", 'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent'=>'Ruby'