summaryrefslogtreecommitdiffstats
path: root/tests/integration
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/feeds.bats21
-rw-r--r--tests/integration/folders.bats17
2 files changed, 36 insertions, 2 deletions
diff --git a/tests/integration/feeds.bats b/tests/integration/feeds.bats
index d8f0aad8c..2701cbfa9 100644
--- a/tests/integration/feeds.bats
+++ b/tests/integration/feeds.bats
@@ -57,6 +57,25 @@ teardown() {
fi
}
+@test "[$TESTSUITE] Read all" {
+ ./occ news:feed:add "$user" "$NC_FEED" --title "Something-${BATS_SUITE_TEST_NUMBER}"
+
+ run ./occ news:feed:list "$user"
+ [ "$status" -eq 0 ]
+
+ echo "$output" | grep "Something-${BATS_SUITE_TEST_NUMBER}"
+
+ ID=$(./occ news:feed:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -2 | head -1 | grep -oE '[0-9]*')
+ run ./occ news:feed:read "$user" "$ID" -v
+ [ "$status" -eq 0 ]
+
+ if ! echo "$output" | grep "items as read"; then
+ ret_status=$?
+ echo "Feed not read"
+ return $ret_status
+ fi
+}
+
@test "[$TESTSUITE] Delete all" {
./occ news:feed:add "$user" "$NC_FEED" --title "Something-${BATS_SUITE_TEST_NUMBER}"
@@ -68,4 +87,4 @@ teardown() {
ID=$(./occ news:feed:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -2 | head -1 | grep -oE '[0-9]*')
run ./occ news:feed:delete "$user" "$ID"
[ "$status" -eq 0 ]
-} \ No newline at end of file
+}
diff --git a/tests/integration/folders.bats b/tests/integration/folders.bats
index 9dde06861..48b15f05b 100644
--- a/tests/integration/folders.bats
+++ b/tests/integration/folders.bats
@@ -36,6 +36,21 @@ teardown() {
fi
}
+@test "[$TESTSUITE] Read all" {
+ ./occ news:folder:add "$user" "Something-${BATS_SUITE_TEST_NUMBER}"
+
+ ID=$(./occ news:folder:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -1 | head -1 | grep -oE '[0-9]*')
+
+ run ./occ news:folder:read "$user" "$ID" -v
+ [ "$status" -eq 0 ]
+
+ if ! echo "$output" | grep "items as read"; then
+ ret_status=$?
+ echo "Folder not read"
+ return $ret_status
+ fi
+}
+
@test "[$TESTSUITE] Delete all" {
ID=$(./occ news:folder:add "$user" "Something-${BATS_SUITE_TEST_NUMBER}" | grep -oE '[0-9]*')
@@ -46,4 +61,4 @@ teardown() {
run ./occ news:folder:delete "$user" "$ID"
[ "$status" -eq 0 ]
-} \ No newline at end of file
+}