1
0
mirror of https://github.com/chylex/Nextcloud-News.git synced 2024-11-24 04:42:46 +01:00
Nextcloud-News/tests/command/opml.bats
Benjamin Brahmer d4450ebad2
Change Autodiscover behaviour (#1860)
* change autodiscover behaviour to only run if the provided url is not already a feed

* Execute feed check after the final url is found

Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>

Co-authored-by: Sean Molenaar <SMillerDev@users.noreply.github.com>
2022-08-08 19:23:42 +02:00

26 lines
613 B
Bash

#!/usr/bin/env bats
load "helpers/settings"
TESTSUITE="OPML"
teardown() {
ID_LIST=($(./occ news:feed:list 'admin' | grep -Po '"id": \K([0-9]+)' | tr '\n' ' '))
for ID in $ID_LIST; do
./occ news:feed:delete "$user" "$ID"
done
}
@test "[$TESTSUITE] Export" {
run ./occ news:feed:add "$user" "https://nextcloud.com/blog/static-feed/" --title "Something-${BATS_SUITE_TEST_NUMBER}"
[ "$status" -eq 0 ]
run ./occ news:opml:export "$user"
[ "$status" -eq 0 ]
if ! echo "$output" | grep "https://nextcloud.com/"; then
ret_status=$?
echo "Feed not exported"
return $ret_status
fi
}