gitlab 4.2.0 → 4.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +33 -0
- data/.travis.yml +8 -3
- data/README.md +7 -7
- data/Rakefile +11 -3
- data/gitlab.gemspec +11 -11
- data/lib/gitlab.rb +2 -2
- data/lib/gitlab/api.rb +2 -1
- data/lib/gitlab/cli.rb +2 -6
- data/lib/gitlab/cli_helpers.rb +18 -20
- data/lib/gitlab/client.rb +8 -5
- data/lib/gitlab/client/branches.rb +4 -4
- data/lib/gitlab/client/build_variables.rb +64 -2
- data/lib/gitlab/client/deployments.rb +32 -0
- data/lib/gitlab/client/groups.rb +49 -0
- data/lib/gitlab/client/issues.rb +71 -0
- data/lib/gitlab/client/merge_requests.rb +1 -0
- data/lib/gitlab/client/pipeline_schedules.rb +133 -0
- data/lib/gitlab/client/pipeline_triggers.rb +2 -2
- data/lib/gitlab/client/projects.rb +1 -1
- data/lib/gitlab/client/repository_files.rb +2 -2
- data/lib/gitlab/client/users.rb +5 -5
- data/lib/gitlab/configuration.rb +2 -2
- data/lib/gitlab/error.rb +10 -2
- data/lib/gitlab/file_response.rb +1 -1
- data/lib/gitlab/help.rb +5 -6
- data/lib/gitlab/page_links.rb +2 -2
- data/lib/gitlab/request.rb +34 -50
- data/lib/gitlab/shell.rb +5 -8
- data/lib/gitlab/version.rb +1 -1
- data/spec/fixtures/deployment.json +57 -0
- data/spec/fixtures/deployments.json +116 -0
- data/spec/fixtures/group_edit.json +14 -0
- data/spec/fixtures/group_subgroups.json +16 -0
- data/spec/fixtures/pipeline_schedule.json +32 -0
- data/spec/fixtures/pipeline_schedule_create.json +21 -0
- data/spec/fixtures/pipeline_schedule_update.json +26 -0
- data/spec/fixtures/pipeline_schedule_variable.json +5 -0
- data/spec/fixtures/pipeline_schedule_variable_update.json +5 -0
- data/spec/fixtures/pipeline_schedules.json +22 -0
- data/spec/gitlab/api_spec.rb +11 -0
- data/spec/gitlab/cli_helpers_spec.rb +14 -15
- data/spec/gitlab/cli_spec.rb +11 -11
- data/spec/gitlab/client/award_emojis_spec.rb +55 -55
- data/spec/gitlab/client/boards_spec.rb +12 -12
- data/spec/gitlab/client/branches_spec.rb +22 -22
- data/spec/gitlab/client/build_variables_spec.rb +93 -10
- data/spec/gitlab/client/builds_spec.rb +36 -36
- data/spec/gitlab/client/commits_spec.rb +21 -21
- data/spec/gitlab/client/deployments_spec.rb +38 -0
- data/spec/gitlab/client/environments_spec.rb +18 -18
- data/spec/gitlab/client/groups_spec.rb +73 -22
- data/spec/gitlab/client/issues_spec.rb +121 -22
- data/spec/gitlab/client/jobs_spec.rb +13 -13
- data/spec/gitlab/client/keys_spec.rb +2 -2
- data/spec/gitlab/client/labels_spec.rb +12 -12
- data/spec/gitlab/client/merge_requests_spec.rb +23 -23
- data/spec/gitlab/client/milestones_spec.rb +12 -12
- data/spec/gitlab/client/namespaces_spec.rb +3 -3
- data/spec/gitlab/client/notes_spec.rb +40 -40
- data/spec/gitlab/client/pipeline_schedules_spec.rb +158 -0
- data/spec/gitlab/client/pipeline_triggers_spec.rb +17 -17
- data/spec/gitlab/client/pipelines_spec.rb +22 -22
- data/spec/gitlab/client/projects_spec.rb +75 -75
- data/spec/gitlab/client/repositories_spec.rb +16 -16
- data/spec/gitlab/client/repository_files_spec.rb +10 -10
- data/spec/gitlab/client/runners_spec.rb +20 -22
- data/spec/gitlab/client/services_spec.rb +6 -6
- data/spec/gitlab/client/snippets_spec.rb +12 -12
- data/spec/gitlab/client/system_hooks_spec.rb +12 -12
- data/spec/gitlab/client/tags_spec.rb +19 -20
- data/spec/gitlab/client/todos_spec.rb +12 -12
- data/spec/gitlab/client/users_spec.rb +49 -49
- data/spec/gitlab/error_spec.rb +50 -23
- data/spec/gitlab/file_response_spec.rb +6 -6
- data/spec/gitlab/help_spec.rb +5 -5
- data/spec/gitlab/objectified_hash_spec.rb +8 -8
- data/spec/gitlab/page_links_spec.rb +1 -1
- data/spec/gitlab/paginated_response_spec.rb +4 -4
- data/spec/gitlab/request_spec.rb +19 -19
- data/spec/gitlab/shell_spec.rb +12 -12
- data/spec/gitlab_spec.rb +13 -14
- data/spec/spec_helper.rb +10 -45
- metadata +46 -3
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Gitlab::Client do
|
4
|
-
it {
|
5
|
-
it {
|
6
|
-
it {
|
7
|
-
it {
|
8
|
-
it {
|
9
|
-
it {
|
4
|
+
it { is_expected.to respond_to :repo_tags }
|
5
|
+
it { is_expected.to respond_to :repo_tag }
|
6
|
+
it { is_expected.to respond_to :repo_create_tag }
|
7
|
+
it { is_expected.to respond_to :repo_delete_tag }
|
8
|
+
it { is_expected.to respond_to :repo_create_release }
|
9
|
+
it { is_expected.to respond_to :repo_update_release }
|
10
10
|
|
11
11
|
describe '.tags' do
|
12
12
|
before do
|
@@ -14,11 +14,11 @@ describe Gitlab::Client do
|
|
14
14
|
@tags = Gitlab.tags(3)
|
15
15
|
end
|
16
16
|
|
17
|
-
it "
|
17
|
+
it "gets the correct resource" do
|
18
18
|
expect(a_get("/projects/3/repository/tags")).to have_been_made
|
19
19
|
end
|
20
20
|
|
21
|
-
it "
|
21
|
+
it "returns a paginated response of repository tags" do
|
22
22
|
expect(@tags).to be_a Gitlab::PaginatedResponse
|
23
23
|
expect(@tags.map(&:name)).to eq(%w[0.0.2 0.0.1])
|
24
24
|
end
|
@@ -30,11 +30,11 @@ describe Gitlab::Client do
|
|
30
30
|
@tag = Gitlab.tag(3, "0.0.1")
|
31
31
|
end
|
32
32
|
|
33
|
-
it "
|
33
|
+
it "gets the correct resource" do
|
34
34
|
expect(a_get("/projects/3/repository/tags/0.0.1")).to have_been_made
|
35
35
|
end
|
36
36
|
|
37
|
-
it "
|
37
|
+
it "returns information about a repository tag" do
|
38
38
|
expect(@tag.name).to eq("0.0.1")
|
39
39
|
end
|
40
40
|
end
|
@@ -45,16 +45,16 @@ describe Gitlab::Client do
|
|
45
45
|
@tag = Gitlab.create_tag(3, "0.0.1", "master", 'this tag is annotated', 'and it has release notes')
|
46
46
|
end
|
47
47
|
|
48
|
-
it "
|
48
|
+
it "gets the correct resource" do
|
49
49
|
expect(a_post("/projects/3/repository/tags")).to have_been_made
|
50
50
|
end
|
51
51
|
|
52
|
-
it "
|
52
|
+
it "returns information about a new repository tag" do
|
53
53
|
expect(@tag.name).to eq("0.0.1")
|
54
54
|
expect(@tag.message).to eq('this tag is annotated')
|
55
55
|
end
|
56
56
|
|
57
|
-
it "
|
57
|
+
it "returns detailed information" do
|
58
58
|
expect(@tag.release.description).to eq('and it has release notes')
|
59
59
|
end
|
60
60
|
end
|
@@ -65,11 +65,11 @@ describe Gitlab::Client do
|
|
65
65
|
@tag = Gitlab.delete_tag(3, "0.0.1")
|
66
66
|
end
|
67
67
|
|
68
|
-
it "
|
68
|
+
it "gets the correct resource" do
|
69
69
|
expect(a_delete("/projects/3/repository/tags/0.0.1")).to have_been_made
|
70
70
|
end
|
71
71
|
|
72
|
-
it "
|
72
|
+
it "returns information about the deleted repository tag" do
|
73
73
|
expect(@tag.tag_name).to eq("0.0.1")
|
74
74
|
end
|
75
75
|
end
|
@@ -80,11 +80,11 @@ describe Gitlab::Client do
|
|
80
80
|
@tag = Gitlab.create_release(3, "0.0.1", "Amazing release. Wow")
|
81
81
|
end
|
82
82
|
|
83
|
-
it "
|
83
|
+
it "gets the correct resource" do
|
84
84
|
expect(a_post("/projects/3/repository/tags/0.0.1/release")).to have_been_made
|
85
85
|
end
|
86
86
|
|
87
|
-
it "
|
87
|
+
it "returns information about the tag and the release" do
|
88
88
|
expect(@tag.tag_name).to eq("0.0.1")
|
89
89
|
expect(@tag.description).to eq("Amazing release. Wow")
|
90
90
|
end
|
@@ -96,14 +96,13 @@ describe Gitlab::Client do
|
|
96
96
|
@tag = Gitlab.update_release(3, "0.0.1", 'Amazing release. Wow')
|
97
97
|
end
|
98
98
|
|
99
|
-
it "
|
99
|
+
it "updates the correct resource" do
|
100
100
|
expect(a_put("/projects/3/repository/tags/0.0.1/release")).to have_been_made
|
101
101
|
end
|
102
102
|
|
103
|
-
it "
|
103
|
+
it "returns information about the tag" do
|
104
104
|
expect(@tag.tag_name).to eq("0.0.1")
|
105
105
|
expect(@tag.description).to eq('Amazing release. Wow')
|
106
106
|
end
|
107
107
|
end
|
108
|
-
|
109
108
|
end
|
@@ -2,17 +2,17 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Gitlab::Client do
|
4
4
|
describe '.todos' do
|
5
|
-
|
6
|
-
|
5
|
+
before do
|
6
|
+
stub_get("/todos", "todos")
|
7
7
|
@todos = Gitlab.todos
|
8
|
-
|
8
|
+
end
|
9
9
|
|
10
|
-
|
10
|
+
it "gets the correct resources" do
|
11
11
|
expect(a_get("/todos")).to have_been_made
|
12
12
|
end
|
13
13
|
|
14
|
-
it "
|
15
|
-
expect(@todos).to be_a Gitlab::PaginatedResponse
|
14
|
+
it "returns a paginated response of user's todos" do
|
15
|
+
expect(@todos).to be_a Gitlab::PaginatedResponse
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -22,13 +22,13 @@ describe Gitlab::Client do
|
|
22
22
|
@todo = Gitlab.mark_todo_as_done(102)
|
23
23
|
end
|
24
24
|
|
25
|
-
it "
|
25
|
+
it "gets the correct resource" do
|
26
26
|
expect(a_post("/todos/102/mark_as_done")).to have_been_made
|
27
27
|
end
|
28
28
|
|
29
|
-
it "
|
29
|
+
it "returns information about the todo marked as done" do
|
30
30
|
expect(@todo.id).to eq(102)
|
31
|
-
expect(@todo.state).to eq('done')
|
31
|
+
expect(@todo.state).to eq('done')
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -38,8 +38,8 @@ describe Gitlab::Client do
|
|
38
38
|
@todos = Gitlab.mark_all_todos_as_done
|
39
39
|
end
|
40
40
|
|
41
|
-
it "
|
41
|
+
it "gets the correct resources" do
|
42
42
|
expect(a_post("/todos/mark_as_done")).to have_been_made
|
43
43
|
end
|
44
|
-
end
|
45
|
-
end
|
44
|
+
end
|
45
|
+
end
|
@@ -7,11 +7,11 @@ describe Gitlab::Client do
|
|
7
7
|
@users = Gitlab.users
|
8
8
|
end
|
9
9
|
|
10
|
-
it "
|
10
|
+
it "gets the correct resource" do
|
11
11
|
expect(a_get("/users")).to have_been_made
|
12
12
|
end
|
13
13
|
|
14
|
-
it "
|
14
|
+
it "returns a paginated response of users" do
|
15
15
|
expect(@users).to be_a Gitlab::PaginatedResponse
|
16
16
|
expect(@users.first.email).to eq("john@example.com")
|
17
17
|
end
|
@@ -24,11 +24,11 @@ describe Gitlab::Client do
|
|
24
24
|
@user = Gitlab.user(1)
|
25
25
|
end
|
26
26
|
|
27
|
-
it "
|
27
|
+
it "gets the correct resource" do
|
28
28
|
expect(a_get("/users/1")).to have_been_made
|
29
29
|
end
|
30
30
|
|
31
|
-
it "
|
31
|
+
it "returns information about a user" do
|
32
32
|
expect(@user.email).to eq("john@example.com")
|
33
33
|
end
|
34
34
|
end
|
@@ -39,11 +39,11 @@ describe Gitlab::Client do
|
|
39
39
|
@user = Gitlab.user
|
40
40
|
end
|
41
41
|
|
42
|
-
it "
|
42
|
+
it "gets the correct resource" do
|
43
43
|
expect(a_get("/user")).to have_been_made
|
44
44
|
end
|
45
45
|
|
46
|
-
it "
|
46
|
+
it "returns information about an authorized user" do
|
47
47
|
expect(@user.email).to eq("john@example.com")
|
48
48
|
end
|
49
49
|
end
|
@@ -56,18 +56,18 @@ describe Gitlab::Client do
|
|
56
56
|
@user = Gitlab.create_user("email", "pass")
|
57
57
|
end
|
58
58
|
|
59
|
-
it "
|
59
|
+
it "gets the correct resource" do
|
60
60
|
body = { email: "email", password: "pass", name: "email" }
|
61
61
|
expect(a_post("/users").with(body: body)).to have_been_made
|
62
62
|
end
|
63
63
|
|
64
|
-
it "
|
64
|
+
it "returns information about a created user" do
|
65
65
|
expect(@user.email).to eq("john@example.com")
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
69
|
context "when bad request" do
|
70
|
-
it "
|
70
|
+
it "throws an exception" do
|
71
71
|
stub_post("/users", "error_already_exists", 409)
|
72
72
|
expect do
|
73
73
|
Gitlab.create_user("email", "pass")
|
@@ -83,18 +83,18 @@ describe Gitlab::Client do
|
|
83
83
|
@user = Gitlab.create_user("email", "pass", "username")
|
84
84
|
end
|
85
85
|
|
86
|
-
it "
|
86
|
+
it "gets the correct resource" do
|
87
87
|
body = { email: "email", password: "pass", username: "username" }
|
88
88
|
expect(a_post("/users").with(body: body)).to have_been_made
|
89
89
|
end
|
90
90
|
|
91
|
-
it "
|
91
|
+
it "returns information about a created user" do
|
92
92
|
expect(@user.email).to eq("john@example.com")
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
96
|
context "when bad request" do
|
97
|
-
it "
|
97
|
+
it "throws an exception" do
|
98
98
|
stub_post("/users", "error_already_exists", 409)
|
99
99
|
expect do
|
100
100
|
Gitlab.create_user("email", "pass", "username")
|
@@ -110,7 +110,7 @@ describe Gitlab::Client do
|
|
110
110
|
@user = Gitlab.edit_user(1, @options)
|
111
111
|
end
|
112
112
|
|
113
|
-
it "
|
113
|
+
it "gets the correct resource" do
|
114
114
|
expect(a_put("/users/1").with(body: @options)).to have_been_made
|
115
115
|
end
|
116
116
|
end
|
@@ -121,11 +121,11 @@ describe Gitlab::Client do
|
|
121
121
|
@user = Gitlab.delete_user(1)
|
122
122
|
end
|
123
123
|
|
124
|
-
it "
|
124
|
+
it "gets the correct resource" do
|
125
125
|
expect(a_delete("/users/1")).to have_been_made
|
126
126
|
end
|
127
127
|
|
128
|
-
it "
|
128
|
+
it "returns information about a deleted user" do
|
129
129
|
expect(@user.email).to eq("john@example.com")
|
130
130
|
end
|
131
131
|
end
|
@@ -136,11 +136,11 @@ describe Gitlab::Client do
|
|
136
136
|
@result = Gitlab.block_user(1)
|
137
137
|
end
|
138
138
|
|
139
|
-
it "
|
139
|
+
it "gets the correct resource" do
|
140
140
|
expect(a_post("/users/1/block")).to have_been_made
|
141
141
|
end
|
142
142
|
|
143
|
-
it "
|
143
|
+
it "returns boolean" do
|
144
144
|
expect(@result).to eq(true)
|
145
145
|
end
|
146
146
|
end
|
@@ -151,11 +151,11 @@ describe Gitlab::Client do
|
|
151
151
|
@result = Gitlab.unblock_user(1)
|
152
152
|
end
|
153
153
|
|
154
|
-
it "
|
154
|
+
it "gets the correct resource" do
|
155
155
|
expect(a_post("/users/1/unblock")).to have_been_made
|
156
156
|
end
|
157
157
|
|
158
|
-
it "
|
158
|
+
it "returns boolean" do
|
159
159
|
expect(@result).to eq(true)
|
160
160
|
end
|
161
161
|
end
|
@@ -173,7 +173,7 @@ describe Gitlab::Client do
|
|
173
173
|
end
|
174
174
|
|
175
175
|
context "when endpoint is not set" do
|
176
|
-
it "
|
176
|
+
it "raises Error::MissingCredentials" do
|
177
177
|
Gitlab.endpoint = nil
|
178
178
|
expect do
|
179
179
|
Gitlab.session("email", "pass")
|
@@ -182,18 +182,18 @@ describe Gitlab::Client do
|
|
182
182
|
end
|
183
183
|
|
184
184
|
context "when private_token is not set" do
|
185
|
-
it "
|
185
|
+
it "does not raise Error::MissingCredentials" do
|
186
186
|
Gitlab.private_token = nil
|
187
187
|
expect { Gitlab.session("email", "pass") }.to_not raise_error
|
188
188
|
end
|
189
189
|
end
|
190
190
|
|
191
191
|
context "when endpoint is set" do
|
192
|
-
it "
|
192
|
+
it "gets the correct resource" do
|
193
193
|
expect(a_request(:post, "#{Gitlab.endpoint}/session")).to have_been_made
|
194
194
|
end
|
195
195
|
|
196
|
-
it "
|
196
|
+
it "returns information about a created session" do
|
197
197
|
expect(@session.email).to eq("john@example.com")
|
198
198
|
expect(@session.private_token).to eq("qEsq1pt6HJPaNciie3MG")
|
199
199
|
end
|
@@ -207,11 +207,11 @@ describe Gitlab::Client do
|
|
207
207
|
@keys = Gitlab.ssh_keys({ user_id: 1 })
|
208
208
|
end
|
209
209
|
|
210
|
-
it "
|
210
|
+
it "gets the correct resource" do
|
211
211
|
expect(a_get("/users/1/keys")).to have_been_made
|
212
212
|
end
|
213
213
|
|
214
|
-
it "
|
214
|
+
it "returns a paginated response of SSH keys" do
|
215
215
|
expect(@keys).to be_a Gitlab::PaginatedResponse
|
216
216
|
expect(@keys.first.title).to eq("narkoz@helium")
|
217
217
|
end
|
@@ -223,11 +223,11 @@ describe Gitlab::Client do
|
|
223
223
|
@keys = Gitlab.ssh_keys
|
224
224
|
end
|
225
225
|
|
226
|
-
it "
|
226
|
+
it "gets the correct resource" do
|
227
227
|
expect(a_get("/user/keys")).to have_been_made
|
228
228
|
end
|
229
229
|
|
230
|
-
it "
|
230
|
+
it "returns a paginated response of SSH keys" do
|
231
231
|
expect(@keys).to be_a Gitlab::PaginatedResponse
|
232
232
|
expect(@keys.first.title).to eq("narkoz@helium")
|
233
233
|
end
|
@@ -240,11 +240,11 @@ describe Gitlab::Client do
|
|
240
240
|
@key = Gitlab.ssh_key(1)
|
241
241
|
end
|
242
242
|
|
243
|
-
it "
|
243
|
+
it "gets the correct resource" do
|
244
244
|
expect(a_get("/user/keys/1")).to have_been_made
|
245
245
|
end
|
246
246
|
|
247
|
-
it "
|
247
|
+
it "returns information about an SSH key" do
|
248
248
|
expect(@key.title).to eq("narkoz@helium")
|
249
249
|
end
|
250
250
|
end
|
@@ -255,12 +255,12 @@ describe Gitlab::Client do
|
|
255
255
|
@key = Gitlab.create_ssh_key("title", "body")
|
256
256
|
end
|
257
257
|
|
258
|
-
it "
|
258
|
+
it "gets the correct resource" do
|
259
259
|
body = { title: "title", key: "body" }
|
260
260
|
expect(a_post("/user/keys").with(body: body)).to have_been_made
|
261
261
|
end
|
262
262
|
|
263
|
-
it "
|
263
|
+
it "returns information about a created SSH key" do
|
264
264
|
expect(@key.title).to eq("narkoz@helium")
|
265
265
|
end
|
266
266
|
end
|
@@ -271,11 +271,11 @@ describe Gitlab::Client do
|
|
271
271
|
@key = Gitlab.delete_ssh_key(1)
|
272
272
|
end
|
273
273
|
|
274
|
-
it "
|
274
|
+
it "gets the correct resource" do
|
275
275
|
expect(a_delete("/user/keys/1")).to have_been_made
|
276
276
|
end
|
277
277
|
|
278
|
-
it "
|
278
|
+
it "returns information about a deleted SSH key" do
|
279
279
|
expect(@key.title).to eq("narkoz@helium")
|
280
280
|
end
|
281
281
|
end
|
@@ -287,11 +287,11 @@ describe Gitlab::Client do
|
|
287
287
|
@emails = Gitlab.emails
|
288
288
|
end
|
289
289
|
|
290
|
-
it "
|
290
|
+
it "gets the correct resource" do
|
291
291
|
expect(a_get("/user/emails")).to have_been_made
|
292
292
|
end
|
293
293
|
|
294
|
-
it "
|
294
|
+
it "returns a information about a emails of user" do
|
295
295
|
email = @emails.first
|
296
296
|
expect(email.id).to eq 1
|
297
297
|
expect(email.email).to eq("email@example.com")
|
@@ -304,11 +304,11 @@ describe Gitlab::Client do
|
|
304
304
|
@emails = Gitlab.emails(2)
|
305
305
|
end
|
306
306
|
|
307
|
-
it "
|
307
|
+
it "gets the correct resource" do
|
308
308
|
expect(a_get("/users/2/emails")).to have_been_made
|
309
309
|
end
|
310
310
|
|
311
|
-
it "
|
311
|
+
it "returns a information about a emails of user" do
|
312
312
|
email = @emails.first
|
313
313
|
expect(email.id).to eq 1
|
314
314
|
expect(email.email).to eq("email@example.com")
|
@@ -322,11 +322,11 @@ describe Gitlab::Client do
|
|
322
322
|
@email = Gitlab.email(2)
|
323
323
|
end
|
324
324
|
|
325
|
-
it "
|
325
|
+
it "gets the correct resource" do
|
326
326
|
expect(a_get("/user/emails/2")).to have_been_made
|
327
327
|
end
|
328
328
|
|
329
|
-
it "
|
329
|
+
it "returns a information about a email of user" do
|
330
330
|
expect(@email.id).to eq 1
|
331
331
|
expect(@email.email).to eq("email@example.com")
|
332
332
|
end
|
@@ -339,12 +339,12 @@ describe Gitlab::Client do
|
|
339
339
|
@email = Gitlab.add_email("email@example.com")
|
340
340
|
end
|
341
341
|
|
342
|
-
it "
|
342
|
+
it "gets the correct resource" do
|
343
343
|
body = { email: "email@example.com" }
|
344
344
|
expect(a_post("/user/emails").with(body: body)).to have_been_made
|
345
345
|
end
|
346
346
|
|
347
|
-
it "
|
347
|
+
it "returns information about a new email" do
|
348
348
|
expect(@email.id).to eq(1)
|
349
349
|
expect(@email.email).to eq("email@example.com")
|
350
350
|
end
|
@@ -356,12 +356,12 @@ describe Gitlab::Client do
|
|
356
356
|
@email = Gitlab.add_email("email@example.com", 2)
|
357
357
|
end
|
358
358
|
|
359
|
-
it "
|
359
|
+
it "gets the correct resource" do
|
360
360
|
body = { email: "email@example.com" }
|
361
361
|
expect(a_post("/users/2/emails").with(body: body)).to have_been_made
|
362
362
|
end
|
363
363
|
|
364
|
-
it "
|
364
|
+
it "returns information about a new email" do
|
365
365
|
expect(@email.id).to eq(1)
|
366
366
|
expect(@email.email).to eq("email@example.com")
|
367
367
|
end
|
@@ -375,11 +375,11 @@ describe Gitlab::Client do
|
|
375
375
|
@email = Gitlab.delete_email(1)
|
376
376
|
end
|
377
377
|
|
378
|
-
it "
|
378
|
+
it "gets the correct resource" do
|
379
379
|
expect(a_delete("/user/emails/1")).to have_been_made
|
380
380
|
end
|
381
381
|
|
382
|
-
it "
|
382
|
+
it "returns information about a deleted email" do
|
383
383
|
expect(@email).to be_truthy
|
384
384
|
end
|
385
385
|
end
|
@@ -390,11 +390,11 @@ describe Gitlab::Client do
|
|
390
390
|
@email = Gitlab.delete_email(1, 2)
|
391
391
|
end
|
392
392
|
|
393
|
-
it "
|
393
|
+
it "gets the correct resource" do
|
394
394
|
expect(a_delete("/users/2/emails/1")).to have_been_made
|
395
395
|
end
|
396
396
|
|
397
|
-
it "
|
397
|
+
it "returns information about a deleted email" do
|
398
398
|
expect(@email).to be_truthy
|
399
399
|
end
|
400
400
|
end
|
@@ -406,11 +406,11 @@ describe Gitlab::Client do
|
|
406
406
|
@users = Gitlab.user_search('User')
|
407
407
|
end
|
408
408
|
|
409
|
-
it "
|
409
|
+
it "gets the correct resource" do
|
410
410
|
expect(a_get("/users?search=User")).to have_been_made
|
411
411
|
end
|
412
412
|
|
413
|
-
it "
|
413
|
+
it "returns an array of users found" do
|
414
414
|
expect(@users.first.id).to eq(1)
|
415
415
|
expect(@users.last.id).to eq(2)
|
416
416
|
end
|