Skip to content

Commit

Permalink
test query for failing test / stub request
Browse files Browse the repository at this point in the history
  • Loading branch information
vasconsaurus committed Jan 24, 2024
1 parent 7b47136 commit c244f11
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/models/parser/twitter_profile_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c244f11

Please sign in to comment.