gitlab 4.4.0 → 4.5.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 +4 -2
- data/gitlab.gemspec +3 -1
- data/lib/gitlab/client.rb +1 -0
- data/lib/gitlab/client/merge_request_approvals.rb +110 -0
- data/lib/gitlab/client/projects.rb +19 -9
- data/lib/gitlab/error.rb +10 -3
- data/lib/gitlab/version.rb +1 -1
- metadata +5 -444
- data/.dockerignore +0 -6
- data/.rubocop.yml +0 -33
- data/.travis.yml +0 -13
- data/Dockerfile +0 -8
- data/docker-compose.yml +0 -19
- data/docker.env +0 -2
- data/spec/fixtures/access_request.json +0 -8
- data/spec/fixtures/access_requests.json +0 -18
- data/spec/fixtures/approved_access_request.json +0 -8
- data/spec/fixtures/board_list.json +0 -1
- data/spec/fixtures/board_lists.json +0 -1
- data/spec/fixtures/boards.json +0 -1
- data/spec/fixtures/branch.json +0 -1
- data/spec/fixtures/branch_delete.json +0 -3
- data/spec/fixtures/branches.json +0 -1
- data/spec/fixtures/build.json +0 -38
- data/spec/fixtures/build_artifacts.json +0 -0
- data/spec/fixtures/build_cancel.json +0 -24
- data/spec/fixtures/build_erase.json +0 -24
- data/spec/fixtures/build_retry.json +0 -24
- data/spec/fixtures/builds.json +0 -78
- data/spec/fixtures/builds_commits.json +0 -64
- data/spec/fixtures/compare_merge_request_diff.json +0 -31
- data/spec/fixtures/default_approved_access_request.json +0 -8
- data/spec/fixtures/deployment.json +0 -57
- data/spec/fixtures/deployments.json +0 -116
- data/spec/fixtures/empty.json +0 -0
- data/spec/fixtures/environment.json +0 -6
- data/spec/fixtures/environments.json +0 -14
- data/spec/fixtures/error_already_exists.json +0 -1
- data/spec/fixtures/error_project_not_found.json +0 -1
- data/spec/fixtures/get_repository_file.json +0 -1
- data/spec/fixtures/group.json +0 -60
- data/spec/fixtures/group_create.json +0 -1
- data/spec/fixtures/group_create_with_description.json +0 -1
- data/spec/fixtures/group_delete.json +0 -1
- data/spec/fixtures/group_edit.json +0 -14
- data/spec/fixtures/group_member.json +0 -1
- data/spec/fixtures/group_member_delete.json +0 -1
- data/spec/fixtures/group_member_edit.json +0 -1
- data/spec/fixtures/group_members.json +0 -1
- data/spec/fixtures/group_milestone.json +0 -1
- data/spec/fixtures/group_milestone_issues.json +0 -1
- data/spec/fixtures/group_milestone_merge_requests.json +0 -1
- data/spec/fixtures/group_milestones.json +0 -1
- data/spec/fixtures/group_projects.json +0 -44
- data/spec/fixtures/group_search.json +0 -2
- data/spec/fixtures/group_subgroups.json +0 -16
- data/spec/fixtures/groups.json +0 -2
- data/spec/fixtures/issue.json +0 -1
- data/spec/fixtures/issue_award_emoji.json +0 -16
- data/spec/fixtures/issue_award_emojis.json +0 -34
- data/spec/fixtures/issues.json +0 -1
- data/spec/fixtures/job.json +0 -43
- data/spec/fixtures/job_trace.json +0 -1
- data/spec/fixtures/jobs.json +0 -91
- data/spec/fixtures/key.json +0 -1
- data/spec/fixtures/keys.json +0 -1
- data/spec/fixtures/label.json +0 -1
- data/spec/fixtures/label_unsubscribe.json +0 -1
- data/spec/fixtures/labels.json +0 -1
- data/spec/fixtures/merge_request.json +0 -1
- data/spec/fixtures/merge_request_award_emoji.json +0 -16
- data/spec/fixtures/merge_request_award_emojis.json +0 -34
- data/spec/fixtures/merge_request_changes.json +0 -1
- data/spec/fixtures/merge_request_closes_issues.json +0 -1
- data/spec/fixtures/merge_request_comment.json +0 -1
- data/spec/fixtures/merge_request_comments.json +0 -1
- data/spec/fixtures/merge_request_commits.json +0 -1
- data/spec/fixtures/merge_request_discussion.json +0 -39
- data/spec/fixtures/merge_request_discussion_note.json +0 -33
- data/spec/fixtures/merge_request_discussions.json +0 -41
- data/spec/fixtures/merge_requests.json +0 -1
- data/spec/fixtures/milestone.json +0 -1
- data/spec/fixtures/milestone_issues.json +0 -1
- data/spec/fixtures/milestone_merge_requests.json +0 -1
- data/spec/fixtures/milestones.json +0 -1
- data/spec/fixtures/namespaces.json +0 -1
- data/spec/fixtures/note.json +0 -1
- data/spec/fixtures/note_award_emoji.json +0 -16
- data/spec/fixtures/note_award_emojis.json +0 -18
- data/spec/fixtures/notes.json +0 -1
- data/spec/fixtures/pipeline.json +0 -23
- data/spec/fixtures/pipeline_cancel.json +0 -23
- data/spec/fixtures/pipeline_create.json +0 -23
- data/spec/fixtures/pipeline_jobs.json +0 -91
- data/spec/fixtures/pipeline_retry.json +0 -23
- data/spec/fixtures/pipeline_schedule.json +0 -32
- data/spec/fixtures/pipeline_schedule_create.json +0 -21
- data/spec/fixtures/pipeline_schedule_update.json +0 -26
- data/spec/fixtures/pipeline_schedule_variable.json +0 -5
- data/spec/fixtures/pipeline_schedule_variable_update.json +0 -5
- data/spec/fixtures/pipeline_schedules.json +0 -22
- data/spec/fixtures/pipelines.json +0 -48
- data/spec/fixtures/project.json +0 -1
- data/spec/fixtures/project_commit.json +0 -13
- data/spec/fixtures/project_commit_comment.json +0 -1
- data/spec/fixtures/project_commit_comments.json +0 -1
- data/spec/fixtures/project_commit_create.json +0 -22
- data/spec/fixtures/project_commit_diff.json +0 -10
- data/spec/fixtures/project_commit_merge_requests.json +0 -1
- data/spec/fixtures/project_commit_status.json +0 -42
- data/spec/fixtures/project_commits.json +0 -1
- data/spec/fixtures/project_edit.json +0 -21
- data/spec/fixtures/project_events.json +0 -81
- data/spec/fixtures/project_for_user.json +0 -1
- data/spec/fixtures/project_fork.json +0 -50
- data/spec/fixtures/project_fork_link.json +0 -1
- data/spec/fixtures/project_forked_for_user.json +0 -50
- data/spec/fixtures/project_forks.json +0 -50
- data/spec/fixtures/project_hook.json +0 -1
- data/spec/fixtures/project_hooks.json +0 -1
- data/spec/fixtures/project_issues.json +0 -1
- data/spec/fixtures/project_key.json +0 -6
- data/spec/fixtures/project_keys.json +0 -6
- data/spec/fixtures/project_runner_enable.json +0 -7
- data/spec/fixtures/project_runners.json +0 -16
- data/spec/fixtures/project_search.json +0 -1
- data/spec/fixtures/project_star.json +0 -44
- data/spec/fixtures/project_tag_annotated.json +0 -1
- data/spec/fixtures/project_tag_lightweight.json +0 -1
- data/spec/fixtures/project_tags.json +0 -1
- data/spec/fixtures/project_unstar.json +0 -44
- data/spec/fixtures/project_update_commit_status.json +0 -20
- data/spec/fixtures/projects.json +0 -1
- data/spec/fixtures/push_rule.json +0 -1
- data/spec/fixtures/raw_file.json +0 -2
- data/spec/fixtures/release_create.json +0 -1
- data/spec/fixtures/release_update.json +0 -1
- data/spec/fixtures/repository_file.json +0 -1
- data/spec/fixtures/run_trigger.json +0 -1
- data/spec/fixtures/runner.json +0 -26
- data/spec/fixtures/runner_delete.json +0 -7
- data/spec/fixtures/runner_edit.json +0 -26
- data/spec/fixtures/runner_jobs.json +0 -63
- data/spec/fixtures/runners.json +0 -16
- data/spec/fixtures/runners_all.json +0 -30
- data/spec/fixtures/service.json +0 -1
- data/spec/fixtures/session.json +0 -1
- data/spec/fixtures/shell_history.json +0 -2
- data/spec/fixtures/sidekiq_compound_metrics.json +0 -36
- data/spec/fixtures/sidekiq_job_stats.json +0 -7
- data/spec/fixtures/sidekiq_process_metrics.json +0 -25
- data/spec/fixtures/sidekiq_queue_metrics.json +0 -8
- data/spec/fixtures/snippet.json +0 -1
- data/spec/fixtures/snippet_award_emoji.json +0 -16
- data/spec/fixtures/snippet_award_emojis.json +0 -34
- data/spec/fixtures/snippet_content.json +0 -3
- data/spec/fixtures/snippets.json +0 -1
- data/spec/fixtures/system_hook.json +0 -1
- data/spec/fixtures/system_hooks.json +0 -1
- data/spec/fixtures/tag.json +0 -1
- data/spec/fixtures/tag_create.json +0 -1
- data/spec/fixtures/tag_create_with_description.json +0 -1
- data/spec/fixtures/tag_delete.json +0 -1
- data/spec/fixtures/tags.json +0 -1
- data/spec/fixtures/team_member.json +0 -1
- data/spec/fixtures/team_members.json +0 -1
- data/spec/fixtures/todo.json +0 -73
- data/spec/fixtures/todos.json +0 -148
- data/spec/fixtures/tree.json +0 -1
- data/spec/fixtures/trigger.json +0 -10
- data/spec/fixtures/triggers.json +0 -12
- data/spec/fixtures/user.json +0 -1
- data/spec/fixtures/user_block_unblock.json +0 -1
- data/spec/fixtures/user_contribution_events.json +0 -101
- data/spec/fixtures/user_email.json +0 -1
- data/spec/fixtures/user_emails.json +0 -1
- data/spec/fixtures/user_events.json +0 -40
- data/spec/fixtures/user_projects.json +0 -153
- data/spec/fixtures/user_search.json +0 -1
- data/spec/fixtures/users.json +0 -1
- data/spec/fixtures/variable.json +0 -4
- data/spec/fixtures/variables.json +0 -10
- data/spec/gitlab/api_spec.rb +0 -11
- data/spec/gitlab/cli_helpers_spec.rb +0 -56
- data/spec/gitlab/cli_spec.rb +0 -119
- data/spec/gitlab/client/access_requests_spec.rb +0 -141
- data/spec/gitlab/client/award_emojis_spec.rb +0 -391
- data/spec/gitlab/client/boards_spec.rb +0 -94
- data/spec/gitlab/client/branches_spec.rb +0 -118
- data/spec/gitlab/client/build_variables_spec.rb +0 -169
- data/spec/gitlab/client/builds_spec.rb +0 -148
- data/spec/gitlab/client/client_spec.rb +0 -11
- data/spec/gitlab/client/commits_spec.rb +0 -190
- data/spec/gitlab/client/deployments_spec.rb +0 -38
- data/spec/gitlab/client/environments_spec.rb +0 -132
- data/spec/gitlab/client/events_spec.rb +0 -48
- data/spec/gitlab/client/group_milestones_spec.rb +0 -98
- data/spec/gitlab/client/groups_spec.rb +0 -246
- data/spec/gitlab/client/issues_spec.rb +0 -285
- data/spec/gitlab/client/jobs_spec.rb +0 -135
- data/spec/gitlab/client/keys_spec.rb +0 -19
- data/spec/gitlab/client/labels_spec.rb +0 -100
- data/spec/gitlab/client/merge_requests_spec.rb +0 -351
- data/spec/gitlab/client/milestones_spec.rb +0 -98
- data/spec/gitlab/client/namespaces_spec.rb +0 -22
- data/spec/gitlab/client/notes_spec.rb +0 -333
- data/spec/gitlab/client/pipeline_schedules_spec.rb +0 -158
- data/spec/gitlab/client/pipeline_triggers_spec.rb +0 -157
- data/spec/gitlab/client/pipelines_spec.rb +0 -95
- data/spec/gitlab/client/projects_spec.rb +0 -630
- data/spec/gitlab/client/repositories_spec.rb +0 -94
- data/spec/gitlab/client/repository_files_spec.rb +0 -95
- data/spec/gitlab/client/runners_spec.rb +0 -193
- data/spec/gitlab/client/services_spec.rb +0 -55
- data/spec/gitlab/client/sidekiq_spec.rb +0 -64
- data/spec/gitlab/client/snippets_spec.rb +0 -100
- data/spec/gitlab/client/system_hooks_spec.rb +0 -69
- data/spec/gitlab/client/tags_spec.rb +0 -152
- data/spec/gitlab/client/todos_spec.rb +0 -45
- data/spec/gitlab/client/users_spec.rb +0 -418
- data/spec/gitlab/error_spec.rb +0 -72
- data/spec/gitlab/file_response_spec.rb +0 -33
- data/spec/gitlab/help_spec.rb +0 -46
- data/spec/gitlab/objectified_hash_spec.rb +0 -48
- data/spec/gitlab/page_links_spec.rb +0 -16
- data/spec/gitlab/paginated_response_spec.rb +0 -60
- data/spec/gitlab/request_spec.rb +0 -73
- data/spec/gitlab/shell_history_spec.rb +0 -53
- data/spec/gitlab/shell_spec.rb +0 -80
- data/spec/gitlab_spec.rb +0 -96
- data/spec/spec_helper.rb +0 -39
@@ -1,141 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Gitlab::Client do
|
4
|
-
describe '.project_access_requests' do
|
5
|
-
before do
|
6
|
-
stub_get("/projects/1/access_requests", "access_requests")
|
7
|
-
@access_requests = Gitlab.project_access_requests(1)
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'gets the correct resources' do
|
11
|
-
expect(a_get("/projects/1/access_requests")).to have_been_made
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'returns a paginated response of project access requests' do
|
15
|
-
expect(@access_requests).to be_a Gitlab::PaginatedResponse
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
describe '.group_access_requests' do
|
20
|
-
before do
|
21
|
-
stub_get("/groups/1/access_requests", "access_requests")
|
22
|
-
@access_requests = Gitlab.group_access_requests(1)
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'gets the correct resources' do
|
26
|
-
expect(a_get("/groups/1/access_requests")).to have_been_made
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'returns a paginated response of group access requests' do
|
30
|
-
expect(@access_requests).to be_a Gitlab::PaginatedResponse
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
describe '.request_project_access' do
|
35
|
-
before do
|
36
|
-
stub_post("/projects/1/access_requests", "access_request")
|
37
|
-
@access_request = Gitlab.request_project_access(1)
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'gets the correct resource' do
|
41
|
-
expect(a_post("/projects/1/access_requests")).to have_been_made
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
describe '.request_group_access' do
|
46
|
-
before do
|
47
|
-
stub_post("/groups/1/access_requests", "access_request")
|
48
|
-
@access_request = Gitlab.request_group_access(1)
|
49
|
-
end
|
50
|
-
|
51
|
-
it 'gets the correct resource' do
|
52
|
-
expect(a_post("/groups/1/access_requests")).to have_been_made
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
describe '.approve_project_access_request' do
|
57
|
-
context 'When no access level is given' do
|
58
|
-
before do
|
59
|
-
stub_put("/projects/1/access_requests/1/approve", "default_approved_access_request")
|
60
|
-
@access_request = Gitlab.approve_project_access_request(1, 1)
|
61
|
-
end
|
62
|
-
|
63
|
-
it 'gets the correct resource' do
|
64
|
-
expect(a_put("/projects/1/access_requests/1/approve")).to have_been_made
|
65
|
-
end
|
66
|
-
|
67
|
-
it "returns information about the project access request" do
|
68
|
-
expect(@access_request.access_level).to eq(30)
|
69
|
-
end
|
70
|
-
end
|
71
|
-
context 'When access level is given' do
|
72
|
-
before do
|
73
|
-
stub_put("/projects/1/access_requests/1/approve", "approved_access_request").with(body: {access_level: '20'})
|
74
|
-
@access_request = Gitlab.approve_project_access_request(1, 1, {access_level: '20'})
|
75
|
-
end
|
76
|
-
|
77
|
-
it 'gets the correct resource' do
|
78
|
-
expect(a_put("/projects/1/access_requests/1/approve").
|
79
|
-
with(body: { access_level: "20" })).to have_been_made
|
80
|
-
end
|
81
|
-
|
82
|
-
it "returns information about the project access request" do
|
83
|
-
expect(@access_request.access_level).to eq(20)
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
describe '.approve_group_access_request' do
|
89
|
-
context 'When no access level is given' do
|
90
|
-
before do
|
91
|
-
stub_put("/groups/1/access_requests/1/approve", "default_approved_access_request")
|
92
|
-
@access_request = Gitlab.approve_group_access_request(1, 1)
|
93
|
-
end
|
94
|
-
|
95
|
-
it 'gets the correct resource' do
|
96
|
-
expect(a_put("/groups/1/access_requests/1/approve")).to have_been_made
|
97
|
-
end
|
98
|
-
|
99
|
-
it "returns information about the group access request" do
|
100
|
-
expect(@access_request.access_level).to eq(30)
|
101
|
-
end
|
102
|
-
end
|
103
|
-
context 'When access level is given' do
|
104
|
-
before do
|
105
|
-
stub_put("/groups/1/access_requests/1/approve", "approved_access_request").with(body: {access_level: '20'})
|
106
|
-
@access_request = Gitlab.approve_group_access_request(1, 1, {access_level: '20'})
|
107
|
-
end
|
108
|
-
|
109
|
-
it 'gets the correct resource' do
|
110
|
-
expect(a_put("/groups/1/access_requests/1/approve").
|
111
|
-
with(body: { access_level: "20" })).to have_been_made
|
112
|
-
end
|
113
|
-
|
114
|
-
it "returns information about the group access request" do
|
115
|
-
expect(@access_request.access_level).to eq(20)
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
describe '.deny_project_access_request' do
|
121
|
-
before do
|
122
|
-
stub_delete("/projects/1/access_requests/1", "access_request")
|
123
|
-
@access_request = Gitlab.deny_project_access_request(1, 1)
|
124
|
-
end
|
125
|
-
|
126
|
-
it 'gets the correct resource' do
|
127
|
-
expect(a_delete("/projects/1/access_requests/1")).to have_been_made
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
|
-
describe '.deny_group_access_request' do
|
132
|
-
before do
|
133
|
-
stub_delete("/groups/1/access_requests/1", "access_request")
|
134
|
-
@access_request = Gitlab.deny_group_access_request(1, 1)
|
135
|
-
end
|
136
|
-
|
137
|
-
it 'gets the correct resource' do
|
138
|
-
expect(a_delete("/groups/1/access_requests/1")).to have_been_made
|
139
|
-
end
|
140
|
-
end
|
141
|
-
end
|
@@ -1,391 +0,0 @@
|
|
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 "gets the correct resources" do
|
12
|
-
expect(a_get("/projects/1/issues/80/award_emoji")).to have_been_made
|
13
|
-
end
|
14
|
-
|
15
|
-
it "returns 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 "gets the correct resources" do
|
29
|
-
expect(a_get("/projects/1/merge_requests/80/award_emoji")).to have_been_made
|
30
|
-
end
|
31
|
-
|
32
|
-
it "returns 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 "gets the correct resources" do
|
46
|
-
expect(a_get("/projects/1/snippets/80/award_emoji")).to have_been_made
|
47
|
-
end
|
48
|
-
|
49
|
-
it "returns 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 "gets 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 "returns 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 "gets 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 "returns 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 "gets 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 "returns 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 "gets the correct resource" do
|
118
|
-
expect(a_get("/projects/1/issues/80/award_emoji/4")).to have_been_made
|
119
|
-
end
|
120
|
-
|
121
|
-
it "returns 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 "gets 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 "returns 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 "gets the correct resource" do
|
152
|
-
expect(a_get("/projects/1/snippets/80/award_emoji/4")).to have_been_made
|
153
|
-
end
|
154
|
-
|
155
|
-
it "returns 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 "gets 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 "returns 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 "gets 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 "returns 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 "gets 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 "returns 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 "gets 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 "returns 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 "gets 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 "returns 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 "gets 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 "returns 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 "gets 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 "returns 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 "gets 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 "returns 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 "gets 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 "returns 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 "gets 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 "gets 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 "gets 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 "gets 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 "gets 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 "gets 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
|