Fix serialization error with video_thumbnail_url (#5933)

This commit is contained in:
rhymes 2020-02-06 16:50:44 +01:00 committed by GitHub
parent a972c8b892
commit 92f6a9f007
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -79,7 +79,7 @@ module Api
title description main_image published_at crossposted_at social_image
cached_tag_list slug path canonical_url comments_count
positive_reactions_count created_at edited_at last_comment_at published
updated_at
updated_at video_thumbnail_url
].freeze
private_constant :INDEX_ATTRIBUTES_FOR_SERIALIZATION

View file

@ -240,6 +240,15 @@ RSpec.describe "Api::V0::Articles", type: :request do
expect(response.headers["surrogate-key"].split.to_set).to eq(expected_key)
end
end
context "with regression tests" do
it "works if both the social image and the main image are missing" do
article.update_columns(social_image: nil, main_image: nil)
get api_articles_path
expect(response).to have_http_status(:ok)
end
end
end
describe "GET /api/articles/:id" do