Merge pull request #650 from scottferg/master

Add verbose user repo feed
This commit is contained in:
Brad Rydzewski 2014-10-30 09:05:53 -07:00
commit b93b244450
2 changed files with 9 additions and 1 deletions

View file

@ -113,7 +113,6 @@ WHERE c.repo_id = r.repo_id
WHERE c.repo_id = r.repo_id
AND r.repo_id = p.repo_id
AND p.user_id = ?
AND c.commit_status NOT IN ('Started', 'Pending')
GROUP BY r.repo_id
) ORDER BY c.commit_created DESC LIMIT 5;
`

View file

@ -203,9 +203,16 @@ func TestCommitstore(t *testing.T) {
Sha: "0a74b46d7d62b737b6906897f48dbeb72cfda222",
Status: model.StatusSuccess,
}
commit4 := model.Commit{
RepoID: repo2.ID,
Branch: "bar",
Sha: "d923a61d8ad3d8d02db4fef0bf40a726bad0fc03",
Status: model.StatusStarted,
}
cs.PostCommit(&commit1)
cs.PostCommit(&commit2)
cs.PostCommit(&commit3)
cs.PostCommit(&commit4)
perm1 := model.Perm{
RepoID: repo1.ID,
UserID: 1,
@ -228,6 +235,8 @@ func TestCommitstore(t *testing.T) {
g.Assert(commits[0].RepoID).Equal(commit1.RepoID)
g.Assert(commits[0].Branch).Equal(commit1.Branch)
g.Assert(commits[0].Sha).Equal(commit1.Sha)
g.Assert(commits[1].Sha).Equal(commit4.Sha)
g.Assert(commits[1].Status).Equal(commit4.Status)
})
g.It("Should enforce unique Sha + Branch", func() {