z_24_b_filetest.gno
0.58 Kb ยท 33 lines
1package main
2
3import (
4 "testing"
5
6 "gno.land/p/gnoland/boards"
7
8 boards2 "gno.land/r/boards000/v1rc1"
9)
10
11const (
12 owner address = "g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq" // @devx
13 admin address = "g1vh7krmmzfua5xjmkatvmx09z37w34lsvd2mxa5"
14)
15
16var bid boards.ID
17
18func init() {
19 testing.SetRealm(testing.NewUserRealm(owner))
20
21 bid = boards2.CreateBoard(cross, "test123", false)
22 boards2.InviteMember(cross, bid, admin, boards2.RoleAdmin)
23}
24
25func main() {
26 testing.SetRealm(testing.NewUserRealm(admin))
27
28 // Calling as a non owner member should fail
29 boards2.GetBoard(bid)
30}
31
32// Error:
33// forbidden