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:
parent
44c9535d06
commit
e992d7db83
1 changed files with 12 additions and 0 deletions
12
spec/requests/articles/articles_feed_spec.rb
Normal file
12
spec/requests/articles/articles_feed_spec.rb
Normal 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
|
||||
Loading…
Add table
Reference in a new issue