summaryrefslogtreecommitdiffstats
path: root/tests/command
diff options
context:
space:
mode:
authorBenjamin Brahmer <info@b-brahmer.de>2022-05-31 15:46:01 +0200
committerGitHub <noreply@github.com>2022-05-31 15:46:01 +0200
commit1c91928e597cad6d41b10ce4b3f34b130453ad27 (patch)
tree5578acc0411c518fb442972edcc7699981277d90 /tests/command
parentdbb641931699e6918896691992ca4ba61d705dc0 (diff)
If items of feed do not provide an author fallback to feed author (#1803)
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Diffstat (limited to 'tests/command')
-rw-r--r--tests/command/feeds/no_guid_feed.xml78
-rw-r--r--tests/command/helpers/settings.bash2
-rw-r--r--tests/command/items.bats14
3 files changed, 93 insertions, 1 deletions
diff --git a/tests/command/feeds/no_guid_feed.xml b/tests/command/feeds/no_guid_feed.xml
new file mode 100644
index 000000000..e27a1b07b
--- /dev/null
+++ b/tests/command/feeds/no_guid_feed.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<rss version="2.0">
+ <channel>
+ <generator>RSS Builder by B!Soft</generator>
+ <title>Joshua Wright Dot Net</title>
+ <link>http://www.joshuawright.net</link>
+ <description>This is a feed of the latest comic masterpiece from joshuawright.net</description>
+ <language>en</language>
+ <managingEditor>joshua.wright@live.com.au (Josh Wright)</managingEditor>
+ <webMaster>joshua.wright@live.com.au (Josh Wright)</webMaster>
+ <copyright>2016 JoshuaWright</copyright>
+ <item>
+ <title>Slack Wyrm 911 - Feeling better</title>
+ <pubDate>Wed, 13 Apr 2022 09:07:01 +0100</pubDate>
+ <link>https://joshuawright.net/slack-wyrm-911.html</link>
+ <description><![CDATA[]]></description>
+ </item>
+ <item>
+ <title>Slack Wyrm 910 - Cake trip</title>
+ <pubDate>Mon, 11 Apr 2022 08:52:54 +0100</pubDate>
+ <link>https://joshuawright.net/slack-wyrm-910.html</link>
+ <description><![CDATA[]]></description>
+ </item>
+ <item>
+ <title>Slack Wyrm 909 - Cake time</title>
+ <pubDate>Fri, 8 Apr 2022 09:29:32 +0100</pubDate>
+ <description><![CDATA[]]></description>
+ </item>
+ <item>
+ <title>Slack Wyrm 908 - Dragons Lair</title>
+ <pubDate>Wed, 6 Apr 2022 09:00:13 +0100</pubDate>
+ <link>https://joshuawright.net/slack-wyrm-908.html</link>
+ <description><![CDATA[]]></description>
+ </item>
+ <item>
+ <title>Slack Wyrm 907 - Ten feet tall</title>
+ <pubDate>Mon, 4 Apr 2022 15:12:51 +0100</pubDate>
+ <link>https://joshuawright.net/slack-wyrm-907.html</link>
+ <description><![CDATA[]]></description>
+ </item>
+ <item>
+ <title>Slack Wyrm 906 - True self</title>
+ <pubDate>Fri, 1 Apr 2022 09:28:06 +1100</pubDate>
+ <link>https://joshuawright.net/slack-wyrm-906.html</link>
+ <description><![CDATA[]]></description>
+ </item>
+ <item>
+ <title>Slack Wyrm 905 - Drink up</title>
+ <pubDate>Wed, 30 Mar 2022 11:07:49 +1100</pubDate>
+ <link>https://joshuawright.net/slack-wyrm-905.html</link>
+ <description><![CDATA[]]></description>
+ </item>
+ <item>
+ <title>Slack Wyrm 904 - Marvellous medicine</title>
+ <pubDate>Mon, 28 Mar 2022 09:02:44 +1100</pubDate>
+ <link>https://joshuawright.net/slack-wyrm-904.html</link>
+ <description><![CDATA[]]></description>
+ </item>
+ <item>
+ <title>Slack Wyrm 903 - Golden still</title>
+ <pubDate>Fri, 25 Mar 2022 09:48:06 +1100</pubDate>
+ <link>https://joshuawright.net/slack-wyrm-903.html</link>
+ <description><![CDATA[]]></description>
+ </item>
+ <item>
+ <title>Slack Wyrm 902 - Janet the genius</title>
+ <pubDate>Wed, 23 Mar 2022 09:30:47 +1100</pubDate>
+ <link>https://joshuawright.net/slack-wyrm-902.html</link>
+ <description><![CDATA[]]></description>
+ </item>
+ <item>
+ <title>Slack Wyrm 901 - Bye bye Bucky</title>
+ <pubDate>Mon, 21 Mar 2022 09:01:36 +1100</pubDate>
+ <link>https://joshuawright.net/slack-wyrm-901.html</link>
+ <description><![CDATA[]]></description>
+ </item>
+ </channel>
+</rss> \ No newline at end of file
diff --git a/tests/command/helpers/settings.bash b/tests/command/helpers/settings.bash
index bf58a601a..d32924ceb 100644
--- a/tests/command/helpers/settings.bash
+++ b/tests/command/helpers/settings.bash
@@ -1,4 +1,4 @@
user=admin
NC_FEED="https://nextcloud.com/blog/static-feed/"
HEISE_FEED="https://www.heise.de/rss/heise-atom.xml"
-NO_GUID_FEED="https://raw.githubusercontent.com/nextcloud/news/master/tests/integration/feeds/no_guid_feed.xml"
+NO_GUID_FEED="https://raw.githubusercontent.com/nextcloud/news/master/tests/command/feeds/no_guid_feed.xml"
diff --git a/tests/command/items.bats b/tests/command/items.bats
index 22a4c73c7..8a7111299 100644
--- a/tests/command/items.bats
+++ b/tests/command/items.bats
@@ -82,3 +82,17 @@ teardown() {
return $ret_status
fi
}
+
+@test "[$TESTSUITE] Test author fallback" {
+ ./occ news:feed:add "$user" $HEISE_FEED --title "Something-${BATS_SUITE_TEST_NUMBER}"
+ ID=$(./occ news:feed:list 'admin' | grep 'heise\.de' -1 | head -1 | grep -oE '[0-9]*')
+
+ run ./occ news:item:list-feed "$user" "$ID" --limit 200
+ [ "$status" -eq 0 ]
+
+ if ! echo "$output" | grep '"author": "heise online",'; then
+ ret_status=$?
+ echo "Author fallback did not work"
+ return $ret_status
+ fi
+} \ No newline at end of file