diff --git a/test/models/parser/twitter_profile_test.rb b/test/models/parser/twitter_profile_test.rb index a5422f68..6e53d9fb 100644 --- a/test/models/parser/twitter_profile_test.rb +++ b/test/models/parser/twitter_profile_test.rb @@ -90,16 +90,16 @@ 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", - 'Accept'=>'*/*', - 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', - 'User-Agent'=>'Ruby' - }) - .to_return(status: 200, body: response_fixture_from_file('twitter-profile-response-success.json')) + + 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: { + 'Accept'=>'*/*', + 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', + 'Authorization'=>'Bearer test', + 'User-Agent'=>'Ruby' + }). + to_return(status: 200, body: response_fixture_from_file('twitter-profile-response-success.json'), headers: {}) data = Parser::TwitterProfile.new('https://m.twitter.com/fake_user').parse_data(empty_doc)