github.com/chenbh/concourse/v6@v6.4.2/atc/integration/active_users_test.go (about)

     1  package integration_test
     2  
     3  import (
     4  	"time"
     5  
     6  	. "github.com/onsi/ginkgo"
     7  	. "github.com/onsi/gomega"
     8  	. "github.com/onsi/gomega/gstruct"
     9  )
    10  
    11  var _ = Describe("ATC Integration Test", func() {
    12  	It("active users are tracked", func() {
    13  		client := login(atcURL, "test", "test")
    14  		twoMonthsAgo := time.Now().AddDate(0, -2, 0)
    15  		users, _ := client.ListActiveUsersSince(twoMonthsAgo)
    16  		Expect(users).To(ConsistOf(MatchFields(IgnoreExtras,
    17  			Fields{"Username": Equal("test")},
    18  		)))
    19  	})
    20  })