-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaccounts_test.go
More file actions
29 lines (26 loc) · 856 Bytes
/
accounts_test.go
File metadata and controls
29 lines (26 loc) · 856 Bytes
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
28
29
package scopes_test
import (
. "gopkg.in/check.v1"
"launchpad.net/go-unityscopes/v2"
)
func (s *S) TestRegisterAccountLoginWidget(c *C) {
widget := scopes.NewPreviewWidget("buttons", "actions")
widget.AddAttributeValue("actions", map[string]interface{}{
"id": "install-snap",
"label": "Install",
})
scopes.RegisterAccountLoginWidget(&widget,
"ubuntuone", "ubuntuone", "ubuntuone",
scopes.PostLoginContinueActivation,
scopes.PostLoginDoNothing)
result, ok := widget["online_account_details"]
c.Check(ok, Equals, true)
c.Check(result, DeepEquals, map[string]interface{}{
"scope_id": "",
"service_name": "ubuntuone",
"service_type": "ubuntuone",
"provider_name": "ubuntuone",
"login_passed_action": scopes.PostLoginContinueActivation,
"login_failed_action": scopes.PostLoginDoNothing,
})
}