@@ -16,21 +16,21 @@ class WebhookOpSpec extends FunSpec with Constants with BeforeAndAfter {
16
16
17
17
describe(" listWebhooks(owner, repo)" ) {
18
18
it(" should succeed with valid owner, repo." ) {
19
- val result = Await .result(api.listWebhooks(organization, repo ), TIMEOUT )
20
- assert(result.length > 0 )
19
+ val result = Await .result(api.listWebhooks(user, userRepo ), TIMEOUT )
20
+ assert(result.length >= 0 )
21
21
}
22
22
}
23
23
24
24
describe(" createWebhook(owner, repo, input)" ) {
25
- it(" should succeed with valid organization , repo, and inputs." ) {
25
+ it(" should succeed with valid user , repo, and inputs." ) {
26
26
val config = WebhookConfig (targetURL)
27
27
val input = WebhookCreateInput (" web" , config, events= Seq (" *" ))
28
- val res = Await .result(api.createWebhook(organization, repo , input), TIMEOUT )
28
+ val res = Await .result(api.createWebhook(user, userRepo , input), TIMEOUT )
29
29
showResponse(res)
30
30
nID = res.id
31
- assert(res.url == " https://api.github.com/repos/" + organization + " /" + repo + " /hooks/" + nID)
32
- assert(res.test_url == " https://api.github.com/repos/" + organization + " /" + repo + " /hooks/" + nID + " /test" )
33
- assert(res.ping_url == " https://api.github.com/repos/" + organization + " /" + repo + " /hooks/" + nID + " /pings" )
31
+ assert(res.url == " https://api.github.com/repos/" + user + " /" + userRepo + " /hooks/" + nID)
32
+ assert(res.test_url == " https://api.github.com/repos/" + user + " /" + userRepo + " /hooks/" + nID + " /test" )
33
+ assert(res.ping_url == " https://api.github.com/repos/" + user + " /" + userRepo + " /hooks/" + nID + " /pings" )
34
34
assert(res.name == " web" )
35
35
assert(res.events == Seq (" *" ))
36
36
assert(res.active == true )
@@ -42,8 +42,8 @@ class WebhookOpSpec extends FunSpec with Constants with BeforeAndAfter {
42
42
}
43
43
44
44
describe(" getWebhook(owner, repo, id)" ) {
45
- it(" should succeed with valid organization , repo and id." ) {
46
- Await .result(api.getWebhook(organization, repo , nID), TIMEOUT ).map { res =>
45
+ it(" should succeed with valid user , repo and id." ) {
46
+ Await .result(api.getWebhook(user, userRepo , nID), TIMEOUT ).map { res =>
47
47
assert(res.id == nID)
48
48
}
49
49
}
@@ -52,49 +52,49 @@ class WebhookOpSpec extends FunSpec with Constants with BeforeAndAfter {
52
52
describe(" updateWebhook(owner, repo, id, input)" ) {
53
53
it(" should succeed updating by rewriting events." ) {
54
54
val input = WebhookUpdateInput (events= Some (Seq (" create" , " pull_request" )))
55
- val res = Await .result(api.updateWebhook(organization, repo , nID, input), TIMEOUT )
55
+ val res = Await .result(api.updateWebhook(user, userRepo , nID, input), TIMEOUT )
56
56
assert(res.events == Seq (" create" , " pull_request" ))
57
57
}
58
58
59
59
it(" should succeed updating by using add_events." ) {
60
60
val input = WebhookUpdateInput (add_events= Some (Seq (" push" )))
61
- val res = Await .result(api.updateWebhook(organization, repo , nID, input), TIMEOUT )
61
+ val res = Await .result(api.updateWebhook(user, userRepo , nID, input), TIMEOUT )
62
62
assert(res.config.url == Some (targetURL))
63
63
assert(res.events == Seq (" create" , " pull_request" , " push" ))
64
64
}
65
65
66
66
it(" should succeed updating by using remove_events." ) {
67
67
val input = WebhookUpdateInput (remove_events= Some (Seq (" pull_request" )))
68
- val res = Await .result(api.updateWebhook(organization, repo , nID, input), TIMEOUT )
68
+ val res = Await .result(api.updateWebhook(user, userRepo , nID, input), TIMEOUT )
69
69
assert(res.config.url == Some (targetURL))
70
70
assert(res.events == Seq (" create" , " push" ))
71
71
}
72
72
73
73
it(" should succeed updating by rewriting config." ) {
74
74
val config = WebhookConfig (targetURL)
75
75
val input = WebhookUpdateInput (Some (config))
76
- val res = Await .result(api.updateWebhook(organization, repo , nID, input), TIMEOUT )
76
+ val res = Await .result(api.updateWebhook(user, userRepo , nID, input), TIMEOUT )
77
77
assert(res.config.url == Some (targetURL))
78
78
}
79
79
}
80
80
81
81
describe(" testWebhook(owner, repo, id)" ) {
82
82
it(" should succeed with valid inputs." ) {
83
- val result = Await .result(api.testWebhook(organization, repo , nID), TIMEOUT )
83
+ val result = Await .result(api.testWebhook(user, userRepo , nID), TIMEOUT )
84
84
assert(result == true )
85
85
}
86
86
}
87
87
88
88
describe(" pingWebhook(owner, repo, id)" ) {
89
89
it(" should succeed with valid inputs." ) {
90
- val result = Await .result(api.pingWebhook(organization, repo , nID), TIMEOUT )
90
+ val result = Await .result(api.pingWebhook(user, userRepo , nID), TIMEOUT )
91
91
assert(result == true )
92
92
}
93
93
}
94
94
95
95
describe(" removeWebhook(owner, repo, id)" ) {
96
96
it(" should succeed with valid inputs." ) {
97
- val result = Await .result(api.removeWebhook(organization, repo , nID), TIMEOUT )
97
+ val result = Await .result(api.removeWebhook(user, userRepo , nID), TIMEOUT )
98
98
assert(result == true )
99
99
}
100
100
}
0 commit comments