425ca29 / test/push.sh
diff --git a/test/push.sh b/test/push.sh index 5764fe2..12486b1 100644 --- a/test/push.sh +++ b/test/push.sh @@ -50,8 +50,17 @@ JS test "$(git ls-remote "$url" HEAD | cut -f1)" = "$old" git -C "$scratch/working" branch other if node "$cli" push --data "$scratch/agent" --source "$scratch/working" --url "$url" --branch other; then exit 1; fi +curl -fsS "http://127.0.0.1:$port/feed" | grep -F 'No posts yet.' node "$cli" push --data "$scratch/agent" --source "$scratch/working" --url "$url" test "$(git ls-remote "$url" HEAD | cut -f1)" = "$new" +node "$cli" push --data "$scratch/agent" --source "$scratch/working" --url "$url" +curl -fsS "http://127.0.0.1:$port/feed" >"$scratch/feed" +test "$(grep -c 'Pushed 1 commit' "$scratch/feed")" -eq 1 +grep -F "href=\"/commit/$new\"" "$scratch/feed" +grep -F ' Update</li>' "$scratch/feed" +update_query=$(sed -n 's/.*href="?update=\([^"]*\)".*/\1/p' "$scratch/feed") +test -n "$update_query" +curl -fsS "http://127.0.0.1:$port/feed?update=$update_query" | grep -F 'Pushed 1 commit' git clone "$url" "$scratch/updated" test "$(git -C "$scratch/updated" rev-parse HEAD)" = "$new" kill "$server" @@ -65,4 +74,5 @@ for attempt in 1 2 3 4 5; do sleep 1 done test "$(git ls-remote "$url" HEAD | cut -f1)" = "$new" +curl -fsS "http://127.0.0.1:$port/feed" | grep -F 'Pushed 1 commit' printf 'PASS: authenticated push published %s and survived cache deletion.\n' "$new"
Git ยท Social feed