Пример #1
0
func TestEveryEntryHasCaptchaSection(t *testing.T) {
	for _, e := range testPosts {
		node := htmltest.QueryOne(t, e.URL, ".author")
		assertElem(t, node, "div")
		require.NotEmpty(t, h5.Children(node), "Empty author div!")
		checkAuthorSection(T{t}, node)
	}
}
Пример #2
0
func TestBasicStructure(t *testing.T) {
	var blocks = []string{
		"#header", "#subheader", "#content", "#footer", "#sidebar",
	}
	for _, block := range blocks {
		node := htmltest.QueryOne(t, "", block)
		assertElem(t, node, "div")
	}
}
Пример #3
0
func TestNewPostShowsEmptyForm(t *testing.T) {
	titleInput := htmltest.QueryOne(t, "edit_post", "#post_title")
	assertElem(t, titleInput, "input")
	bodyTextArea := htmltest.QueryOne(t, "edit_post", "#wmd-input")
	assertElem(t, bodyTextArea, "textarea")
}
Пример #4
0
func TestAdminPageHasAllCommentsButton(t *testing.T) {
	ensureLogin()
	node := htmltest.QueryOne(t, "/admin", "#display-all-comments")
	assertElem(t, node, "input")
}
Пример #5
0
func TestEveryCommentHasEditFormWhenLoggedId(t *testing.T) {
	ensureLogin()
	node := htmltest.QueryOne(t, testPosts[0].URL, "#edit-comment-form")
	assertElem(t, node, "form")
}
Пример #6
0
func TestLoginPage(t *testing.T) {
	node := htmltest.QueryOne(t, "login", "#login_form")
	assertElem(t, node, "form")
}
Пример #7
0
func TestPostPageHasCommentEditor(t *testing.T) {
	for _, p := range testPosts {
		node := htmltest.QueryOne(t, p.URL, "#comment")
		assertElem(t, node, "form")
	}
}