gitlab 4.1.0 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/lib/gitlab/client.rb +4 -0
- data/lib/gitlab/client/award_emojis.rb +135 -0
- data/lib/gitlab/client/boards.rb +88 -0
- data/lib/gitlab/client/branches.rb +12 -7
- data/lib/gitlab/client/commits.rb +6 -6
- data/lib/gitlab/client/environments.rb +87 -0
- data/lib/gitlab/client/labels.rb +33 -4
- data/lib/gitlab/client/merge_requests.rb +0 -59
- data/lib/gitlab/client/notes.rb +106 -0
- data/lib/gitlab/client/projects.rb +48 -44
- data/lib/gitlab/client/repository_files.rb +32 -26
- data/lib/gitlab/client/system_hooks.rb +5 -2
- data/lib/gitlab/client/todos.rb +44 -0
- data/lib/gitlab/version.rb +1 -1
- data/spec/fixtures/board_list.json +1 -0
- data/spec/fixtures/board_lists.json +1 -0
- data/spec/fixtures/boards.json +1 -0
- data/spec/fixtures/environment.json +6 -0
- data/spec/fixtures/environments.json +14 -0
- data/spec/fixtures/issue_award_emoji.json +16 -0
- data/spec/fixtures/issue_award_emojis.json +34 -0
- data/spec/fixtures/label.json +1 -1
- data/spec/fixtures/label_unsubscribe.json +1 -0
- data/spec/fixtures/merge_request_award_emoji.json +16 -0
- data/spec/fixtures/merge_request_award_emojis.json +34 -0
- data/spec/fixtures/note_award_emoji.json +16 -0
- data/spec/fixtures/note_award_emojis.json +18 -0
- data/spec/fixtures/snippet_award_emoji.json +16 -0
- data/spec/fixtures/snippet_award_emojis.json +34 -0
- data/spec/fixtures/todo.json +73 -0
- data/spec/fixtures/todos.json +148 -0
- data/spec/gitlab/client/award_emojis_spec.rb +391 -0
- data/spec/gitlab/client/boards_spec.rb +94 -0
- data/spec/gitlab/client/branches_spec.rb +22 -5
- data/spec/gitlab/client/commits_spec.rb +2 -2
- data/spec/gitlab/client/environments_spec.rb +132 -0
- data/spec/gitlab/client/groups_spec.rb +10 -12
- data/spec/gitlab/client/labels_spec.rb +32 -0
- data/spec/gitlab/client/notes_spec.rb +128 -0
- data/spec/gitlab/client/projects_spec.rb +20 -10
- data/spec/gitlab/client/repository_files_spec.rb +30 -12
- data/spec/gitlab/client/system_hooks_spec.rb +2 -2
- data/spec/gitlab/client/todos_spec.rb +45 -0
- metadata +46 -2
@@ -0,0 +1,148 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"id": 102,
|
4
|
+
"project": {
|
5
|
+
"id": 2,
|
6
|
+
"name": "Gitlab Ce",
|
7
|
+
"name_with_namespace": "Gitlab Org / Gitlab Ce",
|
8
|
+
"path": "gitlab-ce",
|
9
|
+
"path_with_namespace": "gitlab-org/gitlab-ce"
|
10
|
+
},
|
11
|
+
"author": {
|
12
|
+
"name": "Administrator",
|
13
|
+
"username": "root",
|
14
|
+
"id": 1,
|
15
|
+
"state": "active",
|
16
|
+
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
|
17
|
+
"web_url": "https://gitlab.example.com/root"
|
18
|
+
},
|
19
|
+
"action_name": "marked",
|
20
|
+
"target_type": "MergeRequest",
|
21
|
+
"target": {
|
22
|
+
"id": 34,
|
23
|
+
"iid": 7,
|
24
|
+
"project_id": 2,
|
25
|
+
"title": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
|
26
|
+
"description": "Et ea et omnis illum cupiditate. Dolor aspernatur tenetur ducimus facilis est nihil. Quo esse cupiditate molestiae illo corrupti qui quidem dolor.",
|
27
|
+
"state": "opened",
|
28
|
+
"created_at": "2016-06-17T07:49:24.419Z",
|
29
|
+
"updated_at": "2016-06-17T07:52:43.484Z",
|
30
|
+
"target_branch": "tutorials_git_tricks",
|
31
|
+
"source_branch": "DNSBL_docs",
|
32
|
+
"upvotes": 0,
|
33
|
+
"downvotes": 0,
|
34
|
+
"author": {
|
35
|
+
"name": "Maxie Medhurst",
|
36
|
+
"username": "craig_rutherford",
|
37
|
+
"id": 12,
|
38
|
+
"state": "active",
|
39
|
+
"avatar_url": "http://www.gravatar.com/avatar/a0d477b3ea21970ce6ffcbb817b0b435?s=80&d=identicon",
|
40
|
+
"web_url": "https://gitlab.example.com/craig_rutherford"
|
41
|
+
},
|
42
|
+
"assignee": {
|
43
|
+
"name": "Administrator",
|
44
|
+
"username": "root",
|
45
|
+
"id": 1,
|
46
|
+
"state": "active",
|
47
|
+
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
|
48
|
+
"web_url": "https://gitlab.example.com/root"
|
49
|
+
},
|
50
|
+
"source_project_id": 2,
|
51
|
+
"target_project_id": 2,
|
52
|
+
"labels": [],
|
53
|
+
"work_in_progress": false,
|
54
|
+
"milestone": {
|
55
|
+
"id": 32,
|
56
|
+
"iid": 2,
|
57
|
+
"project_id": 2,
|
58
|
+
"title": "v1.0",
|
59
|
+
"description": "Assumenda placeat ea voluptatem voluptate qui.",
|
60
|
+
"state": "active",
|
61
|
+
"created_at": "2016-06-17T07:47:34.163Z",
|
62
|
+
"updated_at": "2016-06-17T07:47:34.163Z",
|
63
|
+
"due_date": null
|
64
|
+
},
|
65
|
+
"merge_when_pipeline_succeeds": false,
|
66
|
+
"merge_status": "cannot_be_merged",
|
67
|
+
"subscribed": true,
|
68
|
+
"user_notes_count": 7
|
69
|
+
},
|
70
|
+
"target_url": "https://gitlab.example.com/gitlab-org/gitlab-ce/merge_requests/7",
|
71
|
+
"body": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
|
72
|
+
"state": "pending",
|
73
|
+
"created_at": "2016-06-17T07:52:35.225Z"
|
74
|
+
},
|
75
|
+
{
|
76
|
+
"id": 98,
|
77
|
+
"project": {
|
78
|
+
"id": 2,
|
79
|
+
"name": "Gitlab Ce",
|
80
|
+
"name_with_namespace": "Gitlab Org / Gitlab Ce",
|
81
|
+
"path": "gitlab-ce",
|
82
|
+
"path_with_namespace": "gitlab-org/gitlab-ce"
|
83
|
+
},
|
84
|
+
"author": {
|
85
|
+
"name": "Maxie Medhurst",
|
86
|
+
"username": "craig_rutherford",
|
87
|
+
"id": 12,
|
88
|
+
"state": "active",
|
89
|
+
"avatar_url": "http://www.gravatar.com/avatar/a0d477b3ea21970ce6ffcbb817b0b435?s=80&d=identicon",
|
90
|
+
"web_url": "https://gitlab.example.com/craig_rutherford"
|
91
|
+
},
|
92
|
+
"action_name": "assigned",
|
93
|
+
"target_type": "MergeRequest",
|
94
|
+
"target": {
|
95
|
+
"id": 34,
|
96
|
+
"iid": 7,
|
97
|
+
"project_id": 2,
|
98
|
+
"title": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
|
99
|
+
"description": "Et ea et omnis illum cupiditate. Dolor aspernatur tenetur ducimus facilis est nihil. Quo esse cupiditate molestiae illo corrupti qui quidem dolor.",
|
100
|
+
"state": "opened",
|
101
|
+
"created_at": "2016-06-17T07:49:24.419Z",
|
102
|
+
"updated_at": "2016-06-17T07:52:43.484Z",
|
103
|
+
"target_branch": "tutorials_git_tricks",
|
104
|
+
"source_branch": "DNSBL_docs",
|
105
|
+
"upvotes": 0,
|
106
|
+
"downvotes": 0,
|
107
|
+
"author": {
|
108
|
+
"name": "Maxie Medhurst",
|
109
|
+
"username": "craig_rutherford",
|
110
|
+
"id": 12,
|
111
|
+
"state": "active",
|
112
|
+
"avatar_url": "http://www.gravatar.com/avatar/a0d477b3ea21970ce6ffcbb817b0b435?s=80&d=identicon",
|
113
|
+
"web_url": "https://gitlab.example.com/craig_rutherford"
|
114
|
+
},
|
115
|
+
"assignee": {
|
116
|
+
"name": "Administrator",
|
117
|
+
"username": "root",
|
118
|
+
"id": 1,
|
119
|
+
"state": "active",
|
120
|
+
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
|
121
|
+
"web_url": "https://gitlab.example.com/root"
|
122
|
+
},
|
123
|
+
"source_project_id": 2,
|
124
|
+
"target_project_id": 2,
|
125
|
+
"labels": [],
|
126
|
+
"work_in_progress": false,
|
127
|
+
"milestone": {
|
128
|
+
"id": 32,
|
129
|
+
"iid": 2,
|
130
|
+
"project_id": 2,
|
131
|
+
"title": "v1.0",
|
132
|
+
"description": "Assumenda placeat ea voluptatem voluptate qui.",
|
133
|
+
"state": "active",
|
134
|
+
"created_at": "2016-06-17T07:47:34.163Z",
|
135
|
+
"updated_at": "2016-06-17T07:47:34.163Z",
|
136
|
+
"due_date": null
|
137
|
+
},
|
138
|
+
"merge_when_pipeline_succeeds": false,
|
139
|
+
"merge_status": "cannot_be_merged",
|
140
|
+
"subscribed": true,
|
141
|
+
"user_notes_count": 7
|
142
|
+
},
|
143
|
+
"target_url": "https://gitlab.example.com/gitlab-org/gitlab-ce/merge_requests/7",
|
144
|
+
"body": "Dolores in voluptatem tenetur praesentium omnis repellendus voluptatem quaerat.",
|
145
|
+
"state": "pending",
|
146
|
+
"created_at": "2016-06-17T07:49:24.624Z"
|
147
|
+
}
|
148
|
+
]
|
@@ -0,0 +1,391 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Gitlab::Client do
|
4
|
+
describe '.award_emojis' do
|
5
|
+
context 'when issue award emojis' do
|
6
|
+
before do
|
7
|
+
stub_get("/projects/1/issues/80/award_emoji", "issue_award_emojis")
|
8
|
+
@emojis = Gitlab.award_emojis(1, 80, 'issue')
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should get the correct resources" do
|
12
|
+
expect(a_get("/projects/1/issues/80/award_emoji")).to have_been_made
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should return a paginated response of issue award emojis" do
|
16
|
+
expect(@emojis).to be_a Gitlab::PaginatedResponse
|
17
|
+
expect(@emojis.first.awardable_id).to eq(80)
|
18
|
+
expect(@emojis.first.awardable_type).to eq("Issue")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'when merge request award emojis' do
|
23
|
+
before do
|
24
|
+
stub_get("/projects/1/merge_requests/80/award_emoji", "merge_request_award_emojis")
|
25
|
+
@emojis = Gitlab.award_emojis(1, 80, 'merge_request')
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should get the correct resources" do
|
29
|
+
expect(a_get("/projects/1/merge_requests/80/award_emoji")).to have_been_made
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should return a paginated response of merge request award emojis" do
|
33
|
+
expect(@emojis).to be_a Gitlab::PaginatedResponse
|
34
|
+
expect(@emojis.first.awardable_id).to eq(80)
|
35
|
+
expect(@emojis.first.awardable_type).to eq("MergeRequest")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
context 'when snippet award emojis' do
|
40
|
+
before do
|
41
|
+
stub_get("/projects/1/snippets/80/award_emoji", "snippet_award_emojis")
|
42
|
+
@emojis = Gitlab.award_emojis(1, 80, 'snippet')
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should get the correct resources" do
|
46
|
+
expect(a_get("/projects/1/snippets/80/award_emoji")).to have_been_made
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should return a paginated response of snippet award emojis" do
|
50
|
+
expect(@emojis).to be_a Gitlab::PaginatedResponse
|
51
|
+
expect(@emojis.first.awardable_id).to eq(80)
|
52
|
+
expect(@emojis.first.awardable_type).to eq("Snippet")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe '.note_award_emojis' do
|
58
|
+
context 'when issue note award emojis' do
|
59
|
+
before do
|
60
|
+
stub_get("/projects/1/issues/80/notes/1/award_emoji", "note_award_emojis")
|
61
|
+
@note_emojis = Gitlab.note_award_emojis(1, 80, 'issue', 1)
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should get the correct resources" do
|
65
|
+
expect(a_get("/projects/1/issues/80/notes/1/award_emoji")).to have_been_made
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should return a paginated response of issue note award emojis" do
|
69
|
+
expect(@note_emojis).to be_a Gitlab::PaginatedResponse
|
70
|
+
expect(@note_emojis.first.awardable_id).to eq(1)
|
71
|
+
expect(@note_emojis.first.awardable_type).to eq("Note")
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
context 'when merge request note award emojis' do
|
76
|
+
before do
|
77
|
+
stub_get("/projects/1/merge_requests/80/notes/1/award_emoji", "note_award_emojis")
|
78
|
+
@note_emojis = Gitlab.note_award_emojis(1, 80, 'merge_request', 1)
|
79
|
+
end
|
80
|
+
|
81
|
+
it "should get the correct resources" do
|
82
|
+
expect(a_get("/projects/1/merge_requests/80/notes/1/award_emoji")).to have_been_made
|
83
|
+
end
|
84
|
+
|
85
|
+
it "should return a paginated response of merge request note award emojis" do
|
86
|
+
expect(@note_emojis).to be_a Gitlab::PaginatedResponse
|
87
|
+
expect(@note_emojis.first.awardable_id).to eq(1)
|
88
|
+
expect(@note_emojis.first.awardable_type).to eq("Note")
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
context 'when snippet note award emojis' do
|
93
|
+
before do
|
94
|
+
stub_get("/projects/1/snippets/80/notes/1/award_emoji", "note_award_emojis")
|
95
|
+
@note_emojis = Gitlab.note_award_emojis(1, 80, 'snippet', 1)
|
96
|
+
end
|
97
|
+
|
98
|
+
it "should get the correct resources" do
|
99
|
+
expect(a_get("/projects/1/snippets/80/notes/1/award_emoji")).to have_been_made
|
100
|
+
end
|
101
|
+
|
102
|
+
it "should return a paginated response of snippet note award emojis" do
|
103
|
+
expect(@note_emojis).to be_a Gitlab::PaginatedResponse
|
104
|
+
expect(@note_emojis.first.awardable_id).to eq(1)
|
105
|
+
expect(@note_emojis.first.awardable_type).to eq("Note")
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
describe '.award_emoji' do
|
111
|
+
context 'when issue award emoji' do
|
112
|
+
before do
|
113
|
+
stub_get("/projects/1/issues/80/award_emoji/4", "issue_award_emoji")
|
114
|
+
@emoji = Gitlab.award_emoji(1, 80, 'issue', 4)
|
115
|
+
end
|
116
|
+
|
117
|
+
it "should get the correct resource" do
|
118
|
+
expect(a_get("/projects/1/issues/80/award_emoji/4")).to have_been_made
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should return information about an issue award emoji" do
|
122
|
+
expect(@emoji.id).to eq(4)
|
123
|
+
expect(@emoji.awardable_type).to eq("Issue")
|
124
|
+
expect(@emoji.awardable_id).to eq(80)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
context 'when merge request award emoji' do
|
129
|
+
before do
|
130
|
+
stub_get("/projects/1/merge_requests/80/award_emoji/4", "merge_request_award_emoji")
|
131
|
+
@emoji = Gitlab.award_emoji(1, 80, 'merge_request', 4)
|
132
|
+
end
|
133
|
+
|
134
|
+
it "should get the correct resource" do
|
135
|
+
expect(a_get("/projects/1/merge_requests/80/award_emoji/4")).to have_been_made
|
136
|
+
end
|
137
|
+
|
138
|
+
it "should return information about a merge request award emoji" do
|
139
|
+
expect(@emoji.id).to eq(4)
|
140
|
+
expect(@emoji.awardable_type).to eq("MergeRequest")
|
141
|
+
expect(@emoji.awardable_id).to eq(80)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
context 'when snippet award emoji' do
|
146
|
+
before do
|
147
|
+
stub_get("/projects/1/snippets/80/award_emoji/4", "snippet_award_emoji")
|
148
|
+
@emoji = Gitlab.award_emoji(1, 80, 'snippet', 4)
|
149
|
+
end
|
150
|
+
|
151
|
+
it "should get the correct resource" do
|
152
|
+
expect(a_get("/projects/1/snippets/80/award_emoji/4")).to have_been_made
|
153
|
+
end
|
154
|
+
|
155
|
+
it "should return information about a snippet award emoji" do
|
156
|
+
expect(@emoji.id).to eq(4)
|
157
|
+
expect(@emoji.awardable_type).to eq("Snippet")
|
158
|
+
expect(@emoji.awardable_id).to eq(80)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
describe '.note_award_emoji' do
|
164
|
+
context 'when issue note award emoji' do
|
165
|
+
before do
|
166
|
+
stub_get("/projects/1/issues/80/notes/1/award_emoji/4", "note_award_emoji")
|
167
|
+
@note_emoji = Gitlab.note_award_emoji(1, 80, 'issue', 1, 4)
|
168
|
+
end
|
169
|
+
|
170
|
+
it "should get the correct resource" do
|
171
|
+
expect(a_get("/projects/1/issues/80/notes/1/award_emoji/4")).to have_been_made
|
172
|
+
end
|
173
|
+
|
174
|
+
it "should return information about an issue note award emoji" do
|
175
|
+
expect(@note_emoji.id).to eq(4)
|
176
|
+
expect(@note_emoji.awardable_type).to eq("Note")
|
177
|
+
expect(@note_emoji.awardable_id).to eq(1)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
context 'when merge request note award emoji' do
|
182
|
+
before do
|
183
|
+
stub_get("/projects/1/merge_requests/80/notes/1/award_emoji/4", "note_award_emoji")
|
184
|
+
@note_emoji = Gitlab.note_award_emoji(1, 80, 'merge_request', 1, 4)
|
185
|
+
end
|
186
|
+
|
187
|
+
it "should get the correct resource" do
|
188
|
+
expect(a_get("/projects/1/merge_requests/80/notes/1/award_emoji/4")).to have_been_made
|
189
|
+
end
|
190
|
+
|
191
|
+
it "should return information about a merge request note award emoji" do
|
192
|
+
expect(@note_emoji.id).to eq(4)
|
193
|
+
expect(@note_emoji.awardable_type).to eq("Note")
|
194
|
+
expect(@note_emoji.awardable_id).to eq(1)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
context 'when snippet note award emoji' do
|
199
|
+
before do
|
200
|
+
stub_get("/projects/1/snippets/80/notes/1/award_emoji/4", "note_award_emoji")
|
201
|
+
@note_emoji = Gitlab.note_award_emoji(1, 80, 'snippet', 1, 4)
|
202
|
+
end
|
203
|
+
|
204
|
+
it "should get the correct resource" do
|
205
|
+
expect(a_get("/projects/1/snippets/80/notes/1/award_emoji/4")).to have_been_made
|
206
|
+
end
|
207
|
+
|
208
|
+
it "should return information about a snippet note award emoji" do
|
209
|
+
expect(@note_emoji.id).to eq(4)
|
210
|
+
expect(@note_emoji.awardable_type).to eq("Note")
|
211
|
+
expect(@note_emoji.awardable_id).to eq(1)
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
describe '.create_award_emoji' do
|
217
|
+
context 'when issue award emoji' do
|
218
|
+
before do
|
219
|
+
stub_post("/projects/1/issues/80/award_emoji", "issue_award_emoji")
|
220
|
+
@emoji = Gitlab.create_award_emoji(1, 80, "issue", "blowfish")
|
221
|
+
end
|
222
|
+
|
223
|
+
it "should get the correct resource" do
|
224
|
+
expect(a_post("/projects/1/issues/80/award_emoji").
|
225
|
+
with(body: { name: 'blowfish' })).to have_been_made
|
226
|
+
end
|
227
|
+
|
228
|
+
it "should return correct information about the created issue award emoji" do
|
229
|
+
expect(@emoji.name).to eq('blowfish')
|
230
|
+
expect(@emoji.awardable_type).to eq('Issue')
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
context 'when merge request award emoji' do
|
235
|
+
before do
|
236
|
+
stub_post("/projects/1/merge_requests/80/award_emoji", "merge_request_award_emoji")
|
237
|
+
@emoji = Gitlab.create_award_emoji(1, 80, "merge_request", "blowfish")
|
238
|
+
end
|
239
|
+
|
240
|
+
it "should get the correct resource" do
|
241
|
+
expect(a_post("/projects/1/merge_requests/80/award_emoji").
|
242
|
+
with(body: { name: 'blowfish' })).to have_been_made
|
243
|
+
end
|
244
|
+
|
245
|
+
it "should return correct information about the created merge request award emoji" do
|
246
|
+
expect(@emoji.name).to eq('blowfish')
|
247
|
+
expect(@emoji.awardable_type).to eq('MergeRequest')
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
context 'when snippet award emoji' do
|
252
|
+
before do
|
253
|
+
stub_post("/projects/1/snippets/80/award_emoji", "snippet_award_emoji")
|
254
|
+
@emoji = Gitlab.create_award_emoji(1, 80, "snippet", "blowfish")
|
255
|
+
end
|
256
|
+
|
257
|
+
it "should get the correct resource" do
|
258
|
+
expect(a_post("/projects/1/snippets/80/award_emoji").
|
259
|
+
with(body: { name: 'blowfish' })).to have_been_made
|
260
|
+
end
|
261
|
+
|
262
|
+
it "should return correct information about the created snippet award emoji" do
|
263
|
+
expect(@emoji.name).to eq('blowfish')
|
264
|
+
expect(@emoji.awardable_type).to eq('Snippet')
|
265
|
+
end
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
describe '.create_note_award_emoji' do
|
270
|
+
context 'when issue note award emoji' do
|
271
|
+
before do
|
272
|
+
stub_post("/projects/1/issues/80/notes/1/award_emoji", "note_award_emoji")
|
273
|
+
@note_emoji = Gitlab.create_note_award_emoji(1, 80, "issue", 1, "mood_bubble_lightning")
|
274
|
+
end
|
275
|
+
|
276
|
+
it "should get the correct resource" do
|
277
|
+
expect(a_post("/projects/1/issues/80/notes/1/award_emoji").
|
278
|
+
with(body: { name: 'mood_bubble_lightning' })).to have_been_made
|
279
|
+
end
|
280
|
+
|
281
|
+
it "should return correct information about the created issue note award emoji" do
|
282
|
+
expect(@note_emoji.name).to eq('mood_bubble_lightning')
|
283
|
+
expect(@note_emoji.awardable_type).to eq('Note')
|
284
|
+
end
|
285
|
+
end
|
286
|
+
|
287
|
+
context 'when merge request note award emoji' do
|
288
|
+
before do
|
289
|
+
stub_post("/projects/1/merge_requests/80/notes/1/award_emoji", "note_award_emoji")
|
290
|
+
@note_emoji = Gitlab.create_note_award_emoji(1, 80, "merge_request", 1, "mood_bubble_lightning")
|
291
|
+
end
|
292
|
+
|
293
|
+
it "should get the correct resource" do
|
294
|
+
expect(a_post("/projects/1/merge_requests/80/notes/1/award_emoji").
|
295
|
+
with(body: { name: 'mood_bubble_lightning' })).to have_been_made
|
296
|
+
end
|
297
|
+
|
298
|
+
it "should return correct information about the created merge request note award emoji" do
|
299
|
+
expect(@note_emoji.name).to eq('mood_bubble_lightning')
|
300
|
+
expect(@note_emoji.awardable_type).to eq('Note')
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
304
|
+
context 'when snippet note award emoji' do
|
305
|
+
before do
|
306
|
+
stub_post("/projects/1/snippets/80/notes/1/award_emoji", "note_award_emoji")
|
307
|
+
@note_emoji = Gitlab.create_note_award_emoji(1, 80, "snippet", 1, "mood_bubble_lightning")
|
308
|
+
end
|
309
|
+
|
310
|
+
it "should get the correct resource" do
|
311
|
+
expect(a_post("/projects/1/snippets/80/notes/1/award_emoji").
|
312
|
+
with(body: { name: 'mood_bubble_lightning' })).to have_been_made
|
313
|
+
end
|
314
|
+
|
315
|
+
it "should return correct information about the created snippet note award emoji" do
|
316
|
+
expect(@note_emoji.name).to eq('mood_bubble_lightning')
|
317
|
+
expect(@note_emoji.awardable_type).to eq('Note')
|
318
|
+
end
|
319
|
+
end
|
320
|
+
end
|
321
|
+
|
322
|
+
describe '.delete_award_emoji' do
|
323
|
+
context 'when issue award emoji' do
|
324
|
+
before do
|
325
|
+
stub_delete("/projects/1/issues/80/award_emoji/4", "issue_award_emoji")
|
326
|
+
@emoji = Gitlab.delete_award_emoji(1, 80, "issue", 4)
|
327
|
+
end
|
328
|
+
|
329
|
+
it "should get the correct resource" do
|
330
|
+
expect(a_delete("/projects/1/issues/80/award_emoji/4")).to have_been_made
|
331
|
+
end
|
332
|
+
end
|
333
|
+
|
334
|
+
context 'when merge request award emoji' do
|
335
|
+
before do
|
336
|
+
stub_delete("/projects/1/merge_requests/80/award_emoji/4", "merge_request_award_emoji")
|
337
|
+
@emoji = Gitlab.delete_award_emoji(1, 80, "merge_request", 4)
|
338
|
+
end
|
339
|
+
|
340
|
+
it "should get the correct resource" do
|
341
|
+
expect(a_delete("/projects/1/merge_requests/80/award_emoji/4")).to have_been_made
|
342
|
+
end
|
343
|
+
end
|
344
|
+
|
345
|
+
context 'when snippet award emoji' do
|
346
|
+
before do
|
347
|
+
stub_delete("/projects/1/snippets/80/award_emoji/4", "snippet_award_emoji")
|
348
|
+
@emoji = Gitlab.delete_award_emoji(1, 80, "snippet", 4)
|
349
|
+
end
|
350
|
+
|
351
|
+
it "should get the correct resource" do
|
352
|
+
expect(a_delete("/projects/1/snippets/80/award_emoji/4")).to have_been_made
|
353
|
+
end
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
357
|
+
describe '.delete_note_award_emoji' do
|
358
|
+
context 'when issue note award emoji' do
|
359
|
+
before do
|
360
|
+
stub_delete("/projects/1/issues/80/notes/1/award_emoji/4", "note_award_emoji")
|
361
|
+
@note_emoji = Gitlab.delete_note_award_emoji(1, 80, "issue", 1, 4)
|
362
|
+
end
|
363
|
+
|
364
|
+
it "should get the correct resource" do
|
365
|
+
expect(a_delete("/projects/1/issues/80/notes/1/award_emoji/4")).to have_been_made
|
366
|
+
end
|
367
|
+
end
|
368
|
+
|
369
|
+
context 'when merge request note award emoji' do
|
370
|
+
before do
|
371
|
+
stub_delete("/projects/1/merge_requests/80/notes/1/award_emoji/4", "note_award_emoji")
|
372
|
+
@note_emoji = Gitlab.delete_note_award_emoji(1, 80, "merge_request", 1, 4)
|
373
|
+
end
|
374
|
+
|
375
|
+
it "should get the correct resource" do
|
376
|
+
expect(a_delete("/projects/1/merge_requests/80/notes/1/award_emoji/4")).to have_been_made
|
377
|
+
end
|
378
|
+
end
|
379
|
+
|
380
|
+
context 'when snippet note award emoji' do
|
381
|
+
before do
|
382
|
+
stub_delete("/projects/1/snippets/80/notes/1/award_emoji/4", "note_award_emoji")
|
383
|
+
@note_emoji = Gitlab.delete_note_award_emoji(1, 80, "snippet", 1, 4)
|
384
|
+
end
|
385
|
+
|
386
|
+
it "should get the correct resource" do
|
387
|
+
expect(a_delete("/projects/1/snippets/80/notes/1/award_emoji/4")).to have_been_made
|
388
|
+
end
|
389
|
+
end
|
390
|
+
end
|
391
|
+
end
|