Ensure that Open Graph image url is absolute

This commit is contained in:
Anton Khorev 2024-06-06 18:01:23 +03:00
parent a73e20cd5c
commit 24c138ac8d
2 changed files with 12 additions and 1 deletions

View file

@ -763,6 +763,17 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest
end
end
def test_show_og_image_with_relative_uri
user = create(:user)
diary_entry = create(:diary_entry, :user => user, :body => "![some local picture](/picture.jpg)")
get diary_entry_path(user, diary_entry)
assert_response :success
assert_dom "head meta[property='og:image']" do
assert_dom "> @content", "#{root_url}picture.jpg"
end
end
def test_hide
user = create(:user)
diary_entry = create(:diary_entry, :user => user)