-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update twitter item tests (and postgres update)
- We don't need that many integration tests, so we are moving some of them back to test/models/parser/twitter_item_test.rb, and updating them to not make live requests, instead they will be stubbed. - I added tests to check the basic request functionality that we now have. And removed "assigns values to hash from the API response" since that is already being tested in "it makes a get request to the tweet lookup endpoint successfully" - "should decode html entities" was removed because that happens inside Media and is not done by the individual parser, which means the test actually fails (as it should) - fake_tweet and fake_twitter_user were removed, since they used methods from the old Twitter gem. Now we are stubbing a response from our new method: tweet_lookup - added .squish to parsed_data['raw']['api']['data'][0]['text'] to clean up line breaks from title and description. Our test was failling because it was not being removed. also since title and description are the same, I just set the description to be the same as the title instead of parsing twice. - separated the stub from the response, so we can also have a failed response. changed the response fixture to be a success one, and added an error one - changed the id and user to make it clear that those are fake and being stubbed. - Removed the test for truncated text, that behavior is no longer present in the v2 api, only retweets might be truncated (we don't fetch those), and the way to deal with it is different. It does not take truncated as a query param. - @url.gsub!(/\s/, '') -> remove whitespaces from the url - raise ApiError.new("#{e.class}: #{e.message}") -> I can get the response code and body, but I get an error when I try the same for the error - upgrade postgres image to 13 (#373) I had upgraded to postgres12-bullseye because of a issue we had when building on Travis: We had an issue with building on Travis that seems related to a change the maintainers of the postgres docker images have made to the underlying OS image layer: Previous: Debian 11 (bullseye) New: Debian 12 (bookworm). The workaround seems to be using postgres-bullseye.More on this here https://stackoverflow.com/questions/76555305/postgres-container-failed-to-start-with-initdb-error-popen-failure-cannot-allo/76591040#76591040 Now updating to 13 I checked which image Devin used in Alegre and am using the same one here.
- Loading branch information
1 parent
54a5b73
commit 3d62936
Showing
7 changed files
with
123 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"errors": [ | ||
{ | ||
"value": "1111111111111111111", | ||
"detail": "Could not find tweet with ids: [1111111111111111111].", | ||
"title": "Not Found Error", | ||
"resource_type": "tweet", | ||
"parameter": "ids", | ||
"resource_id": "1111111111111111111", | ||
"type": "https://api.twitter.com/2/problems/resource-not-found" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.