Add minimal test on rss feed response (#17221)

* Add minimal test on rss feed response

* Update date to string conversion to avoid deprecation

It wouldn't make sense to use a deprecated method here.
This commit is contained in:
Daniel Uber 2022-04-12 16:59:40 -05:00 committed by GitHub
parent 44c9535d06
commit e992d7db83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,12 @@
require "rails_helper"
RSpec.describe "ArticlesFeed", type: :request do
let!(:article) { create(:article) }
it "returns an rss feed with published articles" do
get "/feed"
expect(response.body).to include(article.title)
expect(response.body).to include("<pubDate>#{article.published_at.to_fs(:rfc822)}</pubDate>")
end
end