feat(invite): worked on db & domain model for temp users, #2353
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package sqlstore
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
|
||||
m "github.com/grafana/grafana/pkg/models"
|
||||
)
|
||||
|
||||
func TestTempUserCommandsAndQueries(t *testing.T) {
|
||||
|
||||
Convey("Testing Temp User commands & queries", t, func() {
|
||||
InitTestDB(t)
|
||||
|
||||
Convey("Given saved api key", func() {
|
||||
cmd := m.CreateTempUserCommand{
|
||||
OrgId: 2256,
|
||||
Name: "hello",
|
||||
Email: "e@as.co",
|
||||
IsInvite: true,
|
||||
}
|
||||
err := CreateTempUser(&cmd)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
Convey("Should be able to get temp users by org id", func() {
|
||||
query := m.GetTempUsersForOrgQuery{OrgId: 2256}
|
||||
err = GetTempUsersForOrg(&query)
|
||||
|
||||
So(err, ShouldBeNil)
|
||||
So(len(query.Result), ShouldEqual, 1)
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user