#!/bin/sh
# SPDX-FileCopyrightText: 2006-2014 cgit Development Team
# SPDX-FileCopyrightText: 2026 Project Tick
# SPDX-FileContributor: Project Tick
# SPDX-License-Identifier: GPL-2.0-only

test_description='Check top-level CoC page'
. ./setup.sh

test_expect_success 'index has coc tab' '
	cgit_url "" >tmp &&
	grep "p=coc" tmp &&
	grep "Code of Conduct" tmp
'

test_expect_success 'generate top-level coc page' '
	cgit_query "p=coc" >tmp
'

test_expect_success 'find coc content' '
	grep "site code of conduct" tmp
'

test_expect_success 'repo coc renders top-level coc page' '
	cgit_url "foo/coc" >tmp &&
	grep "site code of conduct" tmp
'

test_done
