gitlab 3.6.1 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. data/.travis.yml +2 -0
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +9 -2
  4. data/gitlab.gemspec +5 -1
  5. data/lib/gitlab.rb +3 -2
  6. data/lib/gitlab/cli_helpers.rb +8 -3
  7. data/lib/gitlab/client.rb +6 -0
  8. data/lib/gitlab/client/build_triggers.rb +51 -0
  9. data/lib/gitlab/client/build_variables.rb +66 -0
  10. data/lib/gitlab/client/builds.rb +106 -0
  11. data/lib/gitlab/client/commits.rb +5 -5
  12. data/lib/gitlab/client/groups.rb +36 -3
  13. data/lib/gitlab/client/issues.rb +16 -3
  14. data/lib/gitlab/client/labels.rb +2 -2
  15. data/lib/gitlab/client/merge_requests.rb +49 -8
  16. data/lib/gitlab/client/milestones.rb +1 -1
  17. data/lib/gitlab/client/notes.rb +28 -1
  18. data/lib/gitlab/client/projects.rb +60 -7
  19. data/lib/gitlab/client/repositories.rb +1 -32
  20. data/lib/gitlab/client/runners.rb +115 -0
  21. data/lib/gitlab/client/services.rb +48 -0
  22. data/lib/gitlab/client/snippets.rb +2 -2
  23. data/lib/gitlab/client/tags.rb +96 -0
  24. data/lib/gitlab/client/users.rb +72 -2
  25. data/lib/gitlab/error.rb +53 -10
  26. data/lib/gitlab/file_response.rb +45 -0
  27. data/lib/gitlab/help.rb +1 -0
  28. data/lib/gitlab/objectified_hash.rb +1 -1
  29. data/lib/gitlab/paginated_response.rb +2 -2
  30. data/lib/gitlab/request.rb +13 -34
  31. data/lib/gitlab/version.rb +1 -1
  32. data/spec/fixtures/build.json +38 -0
  33. data/spec/fixtures/build_artifacts.json +0 -0
  34. data/spec/fixtures/build_cancel.json +24 -0
  35. data/spec/fixtures/build_erase.json +24 -0
  36. data/spec/fixtures/build_retry.json +24 -0
  37. data/spec/fixtures/builds.json +78 -0
  38. data/spec/fixtures/builds_commits.json +64 -0
  39. data/spec/fixtures/error_project_not_found.json +1 -0
  40. data/spec/fixtures/git_hook.json +1 -0
  41. data/spec/fixtures/group_delete.json +1 -0
  42. data/spec/fixtures/group_member_edit.json +1 -0
  43. data/spec/fixtures/group_projects.json +44 -0
  44. data/spec/fixtures/merge_request_commits.json +1 -0
  45. data/spec/fixtures/project_runner_enable.json +7 -0
  46. data/spec/fixtures/project_runners.json +16 -0
  47. data/spec/fixtures/release_create.json +1 -0
  48. data/spec/fixtures/release_update.json +1 -0
  49. data/spec/fixtures/runner.json +26 -0
  50. data/spec/fixtures/runner_delete.json +7 -0
  51. data/spec/fixtures/runner_edit.json +26 -0
  52. data/spec/fixtures/runners.json +16 -0
  53. data/spec/fixtures/runners_all.json +30 -0
  54. data/spec/fixtures/service.json +1 -0
  55. data/spec/fixtures/tag.json +1 -0
  56. data/spec/fixtures/tag_create.json +1 -0
  57. data/spec/fixtures/tag_create_with_description.json +1 -0
  58. data/spec/fixtures/tag_delete.json +1 -0
  59. data/spec/fixtures/tags.json +1 -0
  60. data/spec/fixtures/trigger.json +7 -0
  61. data/spec/fixtures/triggers.json +16 -0
  62. data/spec/fixtures/user_email.json +1 -0
  63. data/spec/fixtures/user_emails.json +1 -0
  64. data/spec/fixtures/user_search.json +1 -0
  65. data/spec/fixtures/variable.json +4 -0
  66. data/spec/fixtures/variables.json +10 -0
  67. data/spec/gitlab/client/build_triggers_spec.rb +67 -0
  68. data/spec/gitlab/client/build_variables_spec.rb +86 -0
  69. data/spec/gitlab/client/builds_spec.rb +148 -0
  70. data/spec/gitlab/client/groups_spec.rb +51 -0
  71. data/spec/gitlab/client/issues_spec.rb +16 -0
  72. data/spec/gitlab/client/merge_requests_spec.rb +27 -4
  73. data/spec/gitlab/client/notes_spec.rb +32 -0
  74. data/spec/gitlab/client/projects_spec.rb +79 -0
  75. data/spec/gitlab/client/runners_spec.rb +185 -0
  76. data/spec/gitlab/client/services_spec.rb +55 -0
  77. data/spec/gitlab/client/tags_spec.rb +109 -0
  78. data/spec/gitlab/client/users_spec.rb +136 -0
  79. data/spec/gitlab/error_spec.rb +45 -0
  80. data/spec/gitlab/file_response_spec.rb +28 -0
  81. data/spec/gitlab/help_spec.rb +6 -1
  82. data/spec/gitlab/request_spec.rb +0 -27
  83. data/spec/gitlab/shell_spec.rb +1 -1
  84. data/spec/spec_helper.rb +2 -2
  85. metadata +131 -23
  86. checksums.yaml +0 -7
@@ -0,0 +1 @@
1
+ {"id":38,"title":"Redmine","created_at":"2015-12-18T14:17:17.592+03:00","updated_at":"2015-12-18T17:55:09.594+03:00","active":true,"push_events":true,"issues_events":true,"merge_requests_events":true,"tag_push_events":true,"note_events":true,"build_events":false,"properties":{"description":"Redmine","project_url":"https://example.com/projects/test_project/issue","issues_url":"https://example.com/issues/:id","new_issue_url":"'https://example.com/projects/test_project/issues/new"}}
@@ -0,0 +1 @@
1
+ {"name":"0.0.1","message":null,"commit":{"id":"c260c39f4d73d9087482d29b4d7a88bec834a3d1","message":"rubocop 100%","parent_ids":["b55be4dc5c052fb0058ef1ea96acd5e4e37f1bed"],"authored_date":"2016-04-29T16:11:32.000+01:00","author_name":"Bob Bloggs","author_email":"bob.bloggs@nowhere","committed_date":"2016-04-29T16:11:32.000+01:00","committer_name":"Bob Bloggs","committer_email":"bob.bloggs@nowhere"},"release":null}
@@ -0,0 +1 @@
1
+ {"name":"0.0.1","message":"this tag is annotated","commit":{"id":"3d3f9288d70f75aa55ea495a3ed5948a628fce11","message":"Added README.md\n","parent_ids":[],"authored_date":"2016-05-25T11:23:07.000+01:00","author_name":"Bob Bloggs","author_email":"bob.bloggs@nowhere","committed_date":"2016-05-25T11:23:07.000+01:00","committer_name":"Bob Bloggs","committer_email":"bob.bloggs@nowhere"},"release":{"tag_name":"0.0.1","description":"and it has release notes"}}
@@ -0,0 +1 @@
1
+ {"name":"0.0.1","message":"this tag is annotated","commit":{"id":"7225ddbe28add8d168e3175266830ab8e6aabdcc","message":"Readme updated","parent_ids":["c3f101968138aa9b09a92c8b6399b3269d17865e"],"authored_date":"2016-03-07T13:38:07.000+00:00","author_name":"Bob Bloggs","author_email":"bob.bloggs@nowhere","committed_date":"2016-03-07T13:38:07.000+00:00","committer_name":"Bob Bloggs","committer_email":"bob.bloggs@nowhere"},"release":null}
@@ -0,0 +1 @@
1
+ {"tag_name":"0.0.1"}
@@ -0,0 +1 @@
1
+ [{"name":"0.0.2","message":null,"commit":{"id":"c260c39f4d73d9087482d29b4d7a88bec834a3d1","message":"rubocop 100%","parent_ids":["b55be4dc5c052fb0058ef1ea96acd5e4e37f1bed"],"authored_date":"2016-04-29T16:11:32.000+01:00","author_name":"Bob Bloggs","author_email":"bob.bloggs@nowhere","committed_date":"2016-04-29T16:11:32.000+01:00","committer_name":"Bob Bloggs","committer_email":"bob.bloggs@nowhere"},"release":null},{"name":"0.0.1","message":null,"commit":{"id":"c260c39f4d73d9087482d29b4d7a88bec834a3d1","message":"rubocop 100%","parent_ids":["b55be4dc5c052fb0058ef1ea96acd5e4e37f1bed"],"authored_date":"2016-04-29T16:11:32.000+01:00","author_name":"Bob Bloggs","author_email":"bob.bloggs@nowhere","committed_date":"2016-04-29T16:11:32.000+01:00","committer_name":"Bob Bloggs","committer_email":"bob.bloggs@nowhere"},"release":null}]
@@ -0,0 +1,7 @@
1
+ {
2
+ "created_at": "2015-12-23T16:25:56.760Z",
3
+ "deleted_at": null,
4
+ "last_used": null,
5
+ "token": "7b9148c158980bbd9bcea92c17522d",
6
+ "updated_at": "2015-12-23T16:25:56.760Z"
7
+ }
@@ -0,0 +1,16 @@
1
+ [
2
+ {
3
+ "created_at": "2015-12-23T16:24:34.716Z",
4
+ "deleted_at": null,
5
+ "last_used": "2016-01-04T15:41:21.986Z",
6
+ "token": "fbdb730c2fbdb095a0862dbd8ab88b",
7
+ "updated_at": "2015-12-23T16:24:34.716Z"
8
+ },
9
+ {
10
+ "created_at": "2015-12-23T16:25:56.760Z",
11
+ "deleted_at": null,
12
+ "last_used": null,
13
+ "token": "7b9148c158980bbd9bcea92c17522d",
14
+ "updated_at": "2015-12-23T16:25:56.760Z"
15
+ }
16
+ ]
@@ -0,0 +1 @@
1
+ {"id":1,"email":"email@example.com"}
@@ -0,0 +1 @@
1
+ [{"id":1,"email":"email@example.com"},{"id":3,"email":"email2@example.com"}]
@@ -0,0 +1 @@
1
+ [{"id":1,"email":"john1@example.com","name":"John Smith 1","username":"john.smith1","bio":null,"skype":"","linkedin":"","twitter":"john1","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:41:56Z"},{"id":2,"email":"john2@example.com","name":"John Smith 2","username":"john.smith2","bio":null,"skype":"","linkedin":"","twitter":"john2","dark_scheme":false,"theme_id":1,"blocked":false,"created_at":"2012-09-17T09:42:56Z"}]
@@ -0,0 +1,4 @@
1
+ {
2
+ "key": "VARIABLE",
3
+ "value": "the value"
4
+ }
@@ -0,0 +1,10 @@
1
+ [
2
+ {
3
+ "key": "TEST_VARIABLE_1",
4
+ "value": "TEST_1"
5
+ },
6
+ {
7
+ "key": "TEST_VARIABLE_2",
8
+ "value": "TEST_2"
9
+ }
10
+ ]
@@ -0,0 +1,67 @@
1
+ require 'spec_helper'
2
+
3
+ describe Gitlab::Client do
4
+ describe ".triggers" do
5
+ before do
6
+ stub_get("/projects/3/triggers", "triggers")
7
+ @triggers = Gitlab.triggers(3)
8
+ end
9
+
10
+ it "should get the correct resource" do
11
+ expect(a_get("/projects/3/triggers")).to have_been_made
12
+ end
13
+
14
+ it "should return an array of project's triggers" do
15
+ expect(@triggers).to be_a Gitlab::PaginatedResponse
16
+ expect(@triggers.first.token).to eq("fbdb730c2fbdb095a0862dbd8ab88b")
17
+ end
18
+ end
19
+
20
+ describe ".trigger" do
21
+ before do
22
+ stub_get("/projects/3/triggers/7b9148c158980bbd9bcea92c17522d", "trigger")
23
+ @trigger = Gitlab.trigger(3, "7b9148c158980bbd9bcea92c17522d")
24
+ end
25
+
26
+ it "should get the correct resource" do
27
+ expect(a_get("/projects/3/triggers/7b9148c158980bbd9bcea92c17522d")).to have_been_made
28
+ end
29
+
30
+ it "should return information about a trigger" do
31
+ expect(@trigger.created_at).to eq("2015-12-23T16:25:56.760Z")
32
+ expect(@trigger.token).to eq("7b9148c158980bbd9bcea92c17522d")
33
+ end
34
+ end
35
+
36
+ describe ".create_trigger" do
37
+ before do
38
+ stub_post("/projects/3/triggers", "trigger")
39
+ @trigger = Gitlab.create_trigger(3)
40
+ end
41
+
42
+ it "should get the correct resource" do
43
+ expect(a_post("/projects/3/triggers")).to have_been_made
44
+ end
45
+
46
+ it "should return information about a new trigger" do
47
+ expect(@trigger.created_at).to eq("2015-12-23T16:25:56.760Z")
48
+ expect(@trigger.token).to eq("7b9148c158980bbd9bcea92c17522d")
49
+ end
50
+ end
51
+
52
+ describe ".remove_trigger" do
53
+ before do
54
+ stub_delete("/projects/3/triggers/7b9148c158980bbd9bcea92c17522d", "trigger")
55
+ @trigger = Gitlab.remove_trigger(3, "7b9148c158980bbd9bcea92c17522d")
56
+ end
57
+
58
+ it "should get the correct resource" do
59
+ expect(a_delete("/projects/3/triggers/7b9148c158980bbd9bcea92c17522d")).to have_been_made
60
+ end
61
+
62
+ it "should return information about a deleted trigger" do
63
+ expect(@trigger.created_at).to eq("2015-12-23T16:25:56.760Z")
64
+ expect(@trigger.token).to eq("7b9148c158980bbd9bcea92c17522d")
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,86 @@
1
+ require 'spec_helper'
2
+
3
+ describe Gitlab::Client do
4
+ describe ".variables" do
5
+ before do
6
+ stub_get("/projects/3/variables", "variables")
7
+ @variables = Gitlab.variables(3)
8
+ end
9
+
10
+ it "should get the correct resource" do
11
+ expect(a_get("/projects/3/variables")).to have_been_made
12
+ end
13
+
14
+ it "should return an array of project's variables" do
15
+ expect(@variables).to be_a Gitlab::PaginatedResponse
16
+ expect(@variables.first.key).to eq("TEST_VARIABLE_1")
17
+ expect(@variables.first.value).to eq("TEST_1")
18
+ end
19
+ end
20
+
21
+ describe ".variable" do
22
+ before do
23
+ stub_get("/projects/3/variables/VARIABLE", "variable")
24
+ @variable = Gitlab.variable(3, "VARIABLE")
25
+ end
26
+
27
+ it "should get the correct resource" do
28
+ expect(a_get("/projects/3/variables/VARIABLE")).to have_been_made
29
+ end
30
+
31
+ it "should return information about a variable" do
32
+ expect(@variable.key).to eq("VARIABLE")
33
+ expect(@variable.value).to eq("the value")
34
+ end
35
+ end
36
+
37
+ describe ".create_variable" do
38
+ before do
39
+ stub_post("/projects/3/variables", "variable")
40
+ @variable = Gitlab.create_variable(3, "NEW_VARIABLE", "new value")
41
+ end
42
+
43
+ it "should get the correct resource" do
44
+ body = { key: "NEW_VARIABLE", value: "new value" }
45
+ expect(a_post("/projects/3/variables").with(body: body)).to have_been_made
46
+ end
47
+
48
+ it "should return information about a new variable" do
49
+ expect(@variable.key).to eq("VARIABLE")
50
+ expect(@variable.value).to eq("the value")
51
+ end
52
+ end
53
+
54
+ describe ".update_variable" do
55
+ before do
56
+ stub_put("/projects/3/variables/UPD_VARIABLE", "variable")
57
+ @variable = Gitlab.update_variable(3, "UPD_VARIABLE", "updated value")
58
+ end
59
+
60
+ it "should put the correct resource" do
61
+ body = { value: "updated value" }
62
+ expect(a_put("/projects/3/variables/UPD_VARIABLE").with(body: body)).to have_been_made
63
+ end
64
+
65
+ it "should return information about an updated variable" do
66
+ expect(@variable.key).to eq("VARIABLE")
67
+ expect(@variable.value).to eq("the value")
68
+ end
69
+ end
70
+
71
+ describe ".remove_variable" do
72
+ before do
73
+ stub_delete("/projects/3/variables/DEL_VARIABLE", "variable")
74
+ @variable = Gitlab.remove_variable(3, "DEL_VARIABLE")
75
+ end
76
+
77
+ it "should get the correct resource" do
78
+ expect(a_delete("/projects/3/variables/DEL_VARIABLE")).to have_been_made
79
+ end
80
+
81
+ it "should return information about a deleted variable" do
82
+ expect(@variable.key).to eq("VARIABLE")
83
+ expect(@variable.value).to eq("the value")
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,148 @@
1
+ require 'spec_helper'
2
+
3
+ describe Gitlab::Client do
4
+ describe ".builds" do
5
+ before do
6
+ stub_get("/projects/3/builds", "builds")
7
+ @builds = Gitlab.builds(3)
8
+ end
9
+
10
+ it "should get the correct resource" do
11
+ expect(a_get("/projects/3/builds")).to have_been_made
12
+ end
13
+
14
+ it "should return a paginated response of project's builds" do
15
+ expect(@builds).to be_a Gitlab::PaginatedResponse
16
+ end
17
+ end
18
+
19
+ describe ".build" do
20
+ before do
21
+ stub_get("/projects/3/builds/8", "build")
22
+ @build = Gitlab.build(3, 8)
23
+ end
24
+
25
+ it "should get the correct resource" do
26
+ expect(a_get("/projects/3/builds/8")).to have_been_made
27
+ end
28
+
29
+ it "should return a single build" do
30
+ expect(@build).to be_a Gitlab::ObjectifiedHash
31
+ end
32
+
33
+ it "should return information about a build" do
34
+ expect(@build.id).to eq(8)
35
+ expect(@build.user.name).to eq("John Smith")
36
+ end
37
+ end
38
+
39
+ describe ".build_artifacts" do
40
+ context "when successful request" do
41
+ before do
42
+ fixture = load_fixture('build_artifacts')
43
+ fixture.set_encoding(Encoding::ASCII_8BIT)
44
+ stub_request(:get, "#{Gitlab.endpoint}/projects/3/builds/8/artifacts").
45
+ with(headers: { 'PRIVATE-TOKEN' => Gitlab.private_token }).
46
+ to_return(body: fixture.read, headers: { 'Content-Disposition' => "attachment; filename=artifacts.zip" })
47
+ @build_artifacts = Gitlab.build_artifacts(3, 8)
48
+ end
49
+
50
+ it "should get the correct resource" do
51
+ expect(a_get("/projects/3/builds/8/artifacts")).to have_been_made
52
+ end
53
+
54
+ it "should return a FileResponse" do
55
+ expect(@build_artifacts).to be_a Gitlab::FileResponse
56
+ end
57
+
58
+ it "should return a file with filename" do
59
+ expect(@build_artifacts.filename).to eq "artifacts.zip"
60
+ end
61
+ end
62
+
63
+ context "when bad request" do
64
+ it "should throw an exception" do
65
+ stub_get("/projects/3/builds/8/artifacts", "error_project_not_found", 404)
66
+ expect{ Gitlab.build_artifacts(3, 8) }.to raise_error(Gitlab::Error::NotFound, "Server responded with code 404, message: 404 Project Not Found. Request URI: #{Gitlab.endpoint}/projects/3/builds/8/artifacts")
67
+ end
68
+ end
69
+ end
70
+
71
+ describe ".builds_commits" do
72
+ before do
73
+ stub_get("/projects/3/repository/commits/0ff3ae198f8601a285adcf5c0fff204ee6fba5fd/builds", "builds_commits")
74
+ @builds_commits = Gitlab.commit_builds(3, "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd")
75
+ end
76
+
77
+ it "should get the correct resource" do
78
+ expect(a_get("/projects/3/repository/commits/0ff3ae198f8601a285adcf5c0fff204ee6fba5fd/builds")).to have_been_made
79
+ end
80
+
81
+ it "should return a paginated response of commit builds" do
82
+ expect(@builds_commits).to be_a Gitlab::PaginatedResponse
83
+ end
84
+
85
+ it "should return information about the builds" do
86
+ expect(@builds_commits.count).to eq(2)
87
+ end
88
+ end
89
+
90
+
91
+
92
+ describe ".build_cancel" do
93
+ before do
94
+ stub_post("/projects/3/builds/8/cancel", "build_cancel")
95
+ @build_cancel = Gitlab.build_cancel(3, 8)
96
+ end
97
+
98
+ it "should get the correct resource" do
99
+ expect(a_post("/projects/3/builds/8/cancel")).to have_been_made
100
+ end
101
+
102
+ it "should return a single build" do
103
+ expect(@build_cancel).to be_a Gitlab::ObjectifiedHash
104
+ end
105
+
106
+ it "should return information about a build" do
107
+ expect(@build_cancel.commit.author_name).to eq("John Smith")
108
+ end
109
+ end
110
+
111
+ describe ".build_retry" do
112
+ before do
113
+ stub_post("/projects/3/builds/69/retry", "build_retry")
114
+ @build_retry = Gitlab.build_retry(3, 69)
115
+ end
116
+
117
+ it "should get the correct resource" do
118
+ expect(a_post("/projects/3/builds/69/retry")).to have_been_made
119
+ end
120
+
121
+ it "should return a single build" do
122
+ expect(@build_retry).to be_a Gitlab::ObjectifiedHash
123
+ end
124
+
125
+ it "should return information about a build" do
126
+ expect(@build_retry.commit.author_name).to eq("John Smith")
127
+ end
128
+ end
129
+
130
+ describe ".build_erase" do
131
+ before do
132
+ stub_post("/projects/3/builds/69/erase", "build_erase")
133
+ @build_retry = Gitlab.build_erase(3, 69)
134
+ end
135
+
136
+ it "should get the correct resource" do
137
+ expect(a_post("/projects/3/builds/69/erase")).to have_been_made
138
+ end
139
+
140
+ it "should return a single build" do
141
+ expect(@build_retry).to be_a Gitlab::ObjectifiedHash
142
+ end
143
+
144
+ it "should return information about a build" do
145
+ expect(@build_retry.commit.author_name).to eq("John Smith")
146
+ end
147
+ end
148
+ end
@@ -58,6 +58,24 @@ describe Gitlab::Client do
58
58
  end
59
59
  end
60
60
 
61
+ describe ".delete_group" do
62
+ context "without description" do
63
+ before do
64
+ stub_delete("/groups/42", "group_delete")
65
+ @group = Gitlab.delete_group(42)
66
+ end
67
+
68
+ it "should get the correct resource" do
69
+ expect(a_delete("/groups/42")).to have_been_made
70
+ end
71
+
72
+ it "should return information about a deleted group" do
73
+ expect(@group.name).to eq("Gitlab-Group")
74
+ expect(@group.path).to eq("gitlab-group")
75
+ end
76
+ end
77
+ end
78
+
61
79
  describe ".transfer_project_to_group" do
62
80
  before do
63
81
  stub_post("/projects", "project")
@@ -113,6 +131,22 @@ describe Gitlab::Client do
113
131
  end
114
132
  end
115
133
 
134
+ describe ".edit_group_member" do
135
+ before do
136
+ stub_put("/groups/3/members/1", "group_member_edit")
137
+ @member = Gitlab.edit_group_member(3, 1, 50)
138
+ end
139
+
140
+ it "should get the correct resource" do
141
+ expect(a_put("/groups/3/members/1")
142
+ .with(body: { access_level: '50'})).to have_been_made
143
+ end
144
+
145
+ it "should return information about the edited member" do
146
+ expect(@member.access_level).to eq(50)
147
+ end
148
+ end
149
+
116
150
  describe ".remove_group_member" do
117
151
  before do
118
152
  stub_delete("/groups/3/members/1", "group_member_delete")
@@ -128,6 +162,23 @@ describe Gitlab::Client do
128
162
  end
129
163
  end
130
164
 
165
+ describe ".group_projects" do
166
+ before do
167
+ stub_get("/groups/4/projects", "group_projects")
168
+ @projects = Gitlab.group_projects(4)
169
+ end
170
+
171
+ it "should get the list of projects" do
172
+ expect(a_get("/groups/4/projects")).to have_been_made
173
+ end
174
+
175
+ it "should return a list of of projects under a group" do
176
+ expect(@projects).to be_a Gitlab::PaginatedResponse
177
+ expect(@projects.size).to eq(1)
178
+ expect(@projects[0].name).to eq("Diaspora Client")
179
+ end
180
+ end
181
+
131
182
  describe ".group_search" do
132
183
  before do
133
184
  stub_get("/groups?search=Group", "group_search")
@@ -119,4 +119,20 @@ describe Gitlab::Client do
119
119
  expect(@issue.assignee.name).to eq("Jack Smith")
120
120
  end
121
121
  end
122
+
123
+ describe ".delete_issue" do
124
+ before do
125
+ stub_delete("/projects/3/issues/33", "issue")
126
+ @issue = Gitlab.delete_issue(3, 33)
127
+ end
128
+
129
+ it "should get the correct resource" do
130
+ expect(a_delete("/projects/3/issues/33")).to have_been_made
131
+ end
132
+
133
+ it "should return information about a deleted issue" do
134
+ expect(@issue.project_id).to eq(3)
135
+ expect(@issue.id).to eq(33)
136
+ end
137
+ end
122
138
  end