Use Non-OGP template if any of required OG tags are missing from the page #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #37.
This patch modifies the behavior of
create_properties_from_page
so that if the page lacks any of the required OGP tags, it will use a Non-OGP template. This patch prevents users from getting a blank link preview when all the previewed page's meta tags are unrelated to OGP.Disregard the part below, I found a way to test this patch :)
There are currently no tests because I'm struggling to develop a way to test this behavior. Scraping is mocked away in the existing test suits, so adding a test for this patch to any of the existing test suits did not make much sense.get_properties
includes fetching the page and extracting the properties, but should we split this method up just so that we can test this patch?