File: peer_test.go

package info (click to toggle)
coyim 0.3.7-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,064 kB
  • ctags: 4,528
  • sloc: xml: 5,120; sh: 328; python: 286; makefile: 235; ruby: 51
file content (27 lines) | stat: -rw-r--r-- 477 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package config

import (
	. "gopkg.in/check.v1"
)

type AccountPeerSuite struct{}

var _ = Suite(&AccountPeerSuite{})

func (s *AccountPeerSuite) Test_Peer_ChangesNicknameAndGroups(c *C) {
	pid := "peer@coy.im"
	a := &Account{
		Account: "account@coy.im",
		Peers: []*Peer{
			&Peer{
				UserID: pid,
			},
		},
	}

	a.SavePeerDetails(pid, "bff", []string{"Foes"})

	p, _ := a.GetPeer(pid)
	c.Check(p.Nickname, Equals, "bff")
	c.Check(p.Groups, DeepEquals, []string{"Foes"})
}