test: add RSS feed endpoint tests
Verify content type, RSS structure, draft exclusion, and language element.
This commit is contained in:
@@ -92,4 +92,15 @@ class ServerTest < Minitest::Test
|
|||||||
assert_includes slugs, "global"
|
assert_includes slugs, "global"
|
||||||
refute_includes slugs, "hello"
|
refute_includes slugs, "hello"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_feed_endpoint
|
||||||
|
get "/api/volumen/feed.xml"
|
||||||
|
assert_predicate last_response, :ok?
|
||||||
|
assert_equal "application/rss+xml", last_response["Content-Type"]&.split(";")&.first
|
||||||
|
body = last_response.body
|
||||||
|
assert_includes body, "<rss version=\"2.0\">"
|
||||||
|
assert_includes body, "<title>Hello</title>"
|
||||||
|
refute_includes body, "Draft"
|
||||||
|
assert_includes body, "<language>en</language>"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user