changed opml route and added controller test for opml endpoint
This commit is contained in:
parent
a1ae215dd4
commit
f972081b1b
2 changed files with 15 additions and 1 deletions
|
|
@ -53,7 +53,7 @@ defmodule PinchflatWeb.Router do
|
||||||
scope "/", PinchflatWeb do
|
scope "/", PinchflatWeb do
|
||||||
pipe_through :feeds
|
pipe_through :feeds
|
||||||
|
|
||||||
get "/opml", Podcasts.PodcastController, :opml_feed
|
get "/podcasts/opml", Podcasts.PodcastController, :opml_feed
|
||||||
|
|
||||||
get "/sources/:uuid/feed", Podcasts.PodcastController, :rss_feed
|
get "/sources/:uuid/feed", Podcasts.PodcastController, :rss_feed
|
||||||
get "/sources/:uuid/feed_image", Podcasts.PodcastController, :feed_image
|
get "/sources/:uuid/feed_image", Podcasts.PodcastController, :feed_image
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,20 @@ defmodule PinchflatWeb.PodcastControllerTest do
|
||||||
import Pinchflat.MediaFixtures
|
import Pinchflat.MediaFixtures
|
||||||
import Pinchflat.SourcesFixtures
|
import Pinchflat.SourcesFixtures
|
||||||
|
|
||||||
|
describe "opml_feed" do
|
||||||
|
test "renders the XML document", %{conn: conn} do
|
||||||
|
source = source_fixture()
|
||||||
|
|
||||||
|
conn = get(conn, ~p"/podcasts/opml" <> ".xml")
|
||||||
|
|
||||||
|
assert conn.status == 200
|
||||||
|
assert {"content-type", "application/opml+xml; charset=utf-8"} in conn.resp_headers
|
||||||
|
assert {"content-disposition", "inline"} in conn.resp_headers
|
||||||
|
assert conn.resp_body =~ ~s"http://www.example.com/sources/#{source.uuid}/feed.xml"
|
||||||
|
assert conn.resp_body =~ "text=\"Cool and good internal name!\""
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "rss_feed" do
|
describe "rss_feed" do
|
||||||
test "renders the XML document", %{conn: conn} do
|
test "renders the XML document", %{conn: conn} do
|
||||||
source = source_fixture()
|
source = source_fixture()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue