1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-24 10:07:21 +02:00

fix failing gitlab and cc tests

This commit is contained in:
Brad Rydzewski 2015-09-30 14:18:09 -07:00
parent 6c81c9cb03
commit 5d586582c8
2 changed files with 6 additions and 4 deletions

View File

@ -2,6 +2,7 @@ package model
import (
"testing"
"time"
"github.com/franela/goblin"
)
@ -12,14 +13,15 @@ func TestCC(t *testing.T) {
g.Describe("CC", func() {
g.It("Should create a project", func() {
now := time.Now().Unix()
now_fmt := time.Unix(now, 0).Format(time.RFC3339)
r := &Repo{
FullName: "foo/bar",
}
b := &Build{
Status: StatusSuccess,
Number: 1,
Started: 1442872675,
Started: now,
}
cc := NewCC(r, b, "http://localhost/foo/bar/1")
@ -27,7 +29,7 @@ func TestCC(t *testing.T) {
g.Assert(cc.Project.Activity).Equal("Sleeping")
g.Assert(cc.Project.LastBuildStatus).Equal("Success")
g.Assert(cc.Project.LastBuildLabel).Equal("1")
g.Assert(cc.Project.LastBuildTime).Equal("2015-09-21T14:57:55-07:00")
g.Assert(cc.Project.LastBuildTime).Equal(now_fmt)
g.Assert(cc.Project.WebURL).Equal("http://localhost/foo/bar/1")
})

View File

@ -40,7 +40,7 @@ func Test_Gitlab(t *testing.T) {
g.Assert(err == nil).IsTrue()
g.Assert(_repo.Name).Equal("diaspora-client")
g.Assert(_repo.Owner).Equal("diaspora")
g.Assert(_repo.Private).Equal(true)
g.Assert(_repo.IsPrivate).Equal(true)
})
g.It("Should return error, when repo not exist", func() {