コード例 #1
0
ファイル: rtfblog_test.go プロジェクト: rtfb/rtfblog
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
ファイル: rtfblog_test.go プロジェクト: rtfb/rtfblog
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
ファイル: rtfblog_test.go プロジェクト: rtfb/rtfblog
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
ファイル: rtfblog_test.go プロジェクト: rtfb/rtfblog
func TestAdminPageHasAllCommentsButton(t *testing.T) {
	ensureLogin()
	node := htmltest.QueryOne(t, "/admin", "#display-all-comments")
	assertElem(t, node, "input")
}
コード例 #5
0
ファイル: rtfblog_test.go プロジェクト: rtfb/rtfblog
func TestEveryCommentHasEditFormWhenLoggedId(t *testing.T) {
	ensureLogin()
	node := htmltest.QueryOne(t, testPosts[0].URL, "#edit-comment-form")
	assertElem(t, node, "form")
}
コード例 #6
0
ファイル: rtfblog_test.go プロジェクト: rtfb/rtfblog
func TestLoginPage(t *testing.T) {
	node := htmltest.QueryOne(t, "login", "#login_form")
	assertElem(t, node, "form")
}
コード例 #7
0
ファイル: rtfblog_test.go プロジェクト: rtfb/rtfblog
func TestPostPageHasCommentEditor(t *testing.T) {
	for _, p := range testPosts {
		node := htmltest.QueryOne(t, p.URL, "#comment")
		assertElem(t, node, "form")
	}
}