Add RSS Feed (#1500)
This commit is contained in:
@@ -63,6 +63,21 @@ context "Frontend" do
|
||||
|
||||
assert_match /#{expected}/, actual
|
||||
end
|
||||
|
||||
test 'rss feed' do
|
||||
channel_title = <<EOF
|
||||
<title>Gollum Wiki Latest Changes</title>
|
||||
EOF
|
||||
item = <<EOF
|
||||
<description>Commited by: <a href="mailto:dawa.ometto@phil.uu.nl">Dawa Ometto</a><br/>Commit ID: 02796b1<br/><br/>Affected files:<ul><li><a href="http://example.org/custom.css/02796b1450691f90db5d6dc6a816a4980ce80d07">custom.css</a></li><li><a href="http://example.org/custom.js/02796b1450691f90db5d6dc6a816a4980ce80d07">custom.js</a></li></ul></description>
|
||||
EOF
|
||||
get '/gollum/feed/'
|
||||
assert last_response.ok?
|
||||
assert_equal 'application/rss+xml', last_response.headers['Content-Type']
|
||||
assert last_response.body.start_with?('<?xml')
|
||||
assert last_response.body.include?(item)
|
||||
assert last_response.body.include?(channel_title)
|
||||
end
|
||||
|
||||
test "show sidebar, header, footer when present" do
|
||||
divs = [@wiki.page("_Header").formatted_data, @wiki.page("_Footer").formatted_data, @wiki.page("_Sidebar").formatted_data]
|
||||
|
||||
@@ -41,7 +41,6 @@ context "Precious::Views::Overview" do
|
||||
test "breadcrumb" do
|
||||
@page.instance_variable_set("@path", "Mordor/Eye-Of-Sauron/Saruman")
|
||||
@page.instance_variable_set("@base_url", "")
|
||||
$stderr.puts @page.breadcrumb.inspect
|
||||
assert_equal "<nav aria-label=\"Breadcrumb\"><ol><li class=\"breadcrumb-item\"><a href=\"/gollum/overview\">Home</a></li>\n<li class=\"breadcrumb-item\"><a href=\"/gollum/overview/Mordor/\">Mordor</a></li>\n<li class=\"breadcrumb-item\"><a href=\"/gollum/overview/Mordor/Eye-Of-Sauron/\">Eye-Of-Sauron</a></li>\n<li class=\"breadcrumb-item\" aria-current=\"page\">Saruman</li>\n</ol></nav>", @page.breadcrumb
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user