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
@@ -0,0 +1,22 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"id": 13,
|
4
|
+
"description": "Test schedule pipeline",
|
5
|
+
"ref": "master",
|
6
|
+
"cron": "* * * * *",
|
7
|
+
"cron_timezone": "Asia/Tokyo",
|
8
|
+
"next_run_at": "2017-05-19T13:41:00.000Z",
|
9
|
+
"active": true,
|
10
|
+
"created_at": "2017-05-19T13:31:08.849Z",
|
11
|
+
"updated_at": "2017-05-19T13:40:17.727Z",
|
12
|
+
"owner": {
|
13
|
+
"name": "Administrator",
|
14
|
+
"username": "root",
|
15
|
+
"id": 1,
|
16
|
+
"state": "active",
|
17
|
+
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
|
18
|
+
"web_url": "https://gitlab.example.com/root"
|
19
|
+
}
|
20
|
+
}
|
21
|
+
]
|
22
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Gitlab::API do
|
4
|
+
let(:default_headers) { subject.class.default_options[:headers] }
|
5
|
+
|
6
|
+
describe ".default_options[:headers]" do
|
7
|
+
it "has 'User-Agent'" do
|
8
|
+
expect(default_headers).to include('User-Agent' => Gitlab::Configuration::DEFAULT_USER_AGENT)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -2,35 +2,34 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Gitlab::CLI::Helpers do
|
4
4
|
describe ".method_owners" do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
expect(
|
10
|
-
expect(
|
11
|
-
expect(@methods.all? { |m| m.keys.sort === [:name, :owner] }).to be true
|
5
|
+
let(:methods) { Gitlab::CLI::Helpers.method_owners }
|
6
|
+
|
7
|
+
it "returns Array of Hashes containing method names and owners" do
|
8
|
+
expect(methods).to be_a Array
|
9
|
+
expect(methods.all? { |m| m.is_a? Hash }).to be true
|
10
|
+
expect(methods.all? { |m| m.keys.sort == %i(name owner) }).to be true
|
12
11
|
end
|
13
12
|
end
|
14
13
|
|
15
14
|
describe ".valid_command?" do
|
16
|
-
it "
|
17
|
-
expect(Gitlab::CLI::Helpers.valid_command?
|
15
|
+
it "returns true when command is valid" do
|
16
|
+
expect(Gitlab::CLI::Helpers.valid_command?('merge_requests')).to be_truthy
|
18
17
|
end
|
19
|
-
it "
|
20
|
-
expect(Gitlab::CLI::Helpers.valid_command?
|
18
|
+
it "returns false when command is NOT valid" do
|
19
|
+
expect(Gitlab::CLI::Helpers.valid_command?('mmmmmerge_requests')).to be_falsy
|
21
20
|
end
|
22
21
|
end
|
23
22
|
|
24
23
|
describe ".symbolize_keys" do
|
25
24
|
context "when input is a Hash" do
|
26
|
-
it "
|
25
|
+
it "returns a Hash with symbols for keys" do
|
27
26
|
hash = { 'key1' => 'val1', 'key2' => 'val2' }
|
28
27
|
symbolized_hash = Gitlab::CLI::Helpers.symbolize_keys(hash)
|
29
28
|
expect(symbolized_hash).to eq(key1: 'val1', key2: 'val2')
|
30
29
|
end
|
31
30
|
end
|
32
31
|
context "when input is NOT a Hash" do
|
33
|
-
it "
|
32
|
+
it "returns input untouched" do
|
34
33
|
array = [1, 2, 3]
|
35
34
|
new_array = Gitlab::CLI::Helpers.symbolize_keys(array)
|
36
35
|
expect(new_array).to eq([1, 2, 3])
|
@@ -40,7 +39,7 @@ describe Gitlab::CLI::Helpers do
|
|
40
39
|
|
41
40
|
describe ".yaml_load" do
|
42
41
|
context "when argument is a YAML string" do
|
43
|
-
it "
|
42
|
+
it "returns Ruby objects" do
|
44
43
|
argument = "{foo: bar, sna: fu}"
|
45
44
|
output = Gitlab::CLI::Helpers.yaml_load argument
|
46
45
|
expect(output).to eq('foo' => 'bar', 'sna' => 'fu')
|
@@ -48,7 +47,7 @@ describe Gitlab::CLI::Helpers do
|
|
48
47
|
end
|
49
48
|
|
50
49
|
context "when input is NOT valid YAML" do
|
51
|
-
it "
|
50
|
+
it "raises a TypeError" do
|
52
51
|
ruby_array = [1, 2, 3, 4]
|
53
52
|
expect { Gitlab::CLI::Helpers.yaml_load ruby_array }.to raise_error TypeError
|
54
53
|
end
|
data/spec/gitlab/cli_spec.rb
CHANGED
@@ -4,14 +4,14 @@ require 'json'
|
|
4
4
|
describe Gitlab::CLI do
|
5
5
|
describe ".run" do
|
6
6
|
context "when command is version" do
|
7
|
-
it "
|
7
|
+
it "shows gem version" do
|
8
8
|
output = capture_output { Gitlab::CLI.run('-v') }
|
9
9
|
expect(output).to eq("Gitlab Ruby Gem #{Gitlab::VERSION}\n")
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
context "when command is info" do
|
14
|
-
it "
|
14
|
+
it "shows environment info" do
|
15
15
|
output = capture_output { Gitlab::CLI.run('info') }
|
16
16
|
expect(output).to include("Gitlab endpoint is")
|
17
17
|
expect(output).to include("Gitlab private token is")
|
@@ -21,7 +21,7 @@ describe Gitlab::CLI do
|
|
21
21
|
end
|
22
22
|
|
23
23
|
context "when command is help" do
|
24
|
-
it "
|
24
|
+
it "shows available actions" do
|
25
25
|
output = capture_output { Gitlab::CLI.run('help') }
|
26
26
|
expect(output).to include('Help Topics')
|
27
27
|
expect(output).to include('MergeRequests')
|
@@ -34,11 +34,11 @@ describe Gitlab::CLI do
|
|
34
34
|
@output = capture_output { Gitlab::CLI.run('user') }
|
35
35
|
end
|
36
36
|
|
37
|
-
it "
|
37
|
+
it "shows executed command" do
|
38
38
|
expect(@output).to include('Gitlab.user')
|
39
39
|
end
|
40
40
|
|
41
|
-
it "
|
41
|
+
it "shows user data" do
|
42
42
|
expect(@output).to include('name')
|
43
43
|
expect(@output).to include('John Smith')
|
44
44
|
end
|
@@ -50,11 +50,11 @@ describe Gitlab::CLI do
|
|
50
50
|
@output = capture_output { Gitlab::CLI.run('users') }
|
51
51
|
end
|
52
52
|
|
53
|
-
it "
|
53
|
+
it "shows executed command" do
|
54
54
|
expect(@output).to include('Gitlab.users')
|
55
55
|
end
|
56
56
|
|
57
|
-
it "
|
57
|
+
it "shows users data" do
|
58
58
|
expect(@output).to include('name')
|
59
59
|
expect(@output).to include('John Smith')
|
60
60
|
expect(@output).to include('Jack Smith')
|
@@ -70,7 +70,7 @@ describe Gitlab::CLI do
|
|
70
70
|
@output = capture_output { Gitlab::CLI.start(args) }
|
71
71
|
end
|
72
72
|
|
73
|
-
it "
|
73
|
+
it "shows user data with excluded fields" do
|
74
74
|
expect(@output).to_not include('John Smith')
|
75
75
|
expect(@output).to include('bio')
|
76
76
|
expect(@output).to include('created_at')
|
@@ -84,7 +84,7 @@ describe Gitlab::CLI do
|
|
84
84
|
@output = capture_output { Gitlab::CLI.start(args) }
|
85
85
|
end
|
86
86
|
|
87
|
-
it "
|
87
|
+
it "renders output as json" do
|
88
88
|
expect(JSON.parse(@output)['result']).to eq(JSON.parse(File.read(File.dirname(__FILE__) + '/../fixtures/user.json')))
|
89
89
|
expect(JSON.parse(@output)['cmd']).to eq('Gitlab.user')
|
90
90
|
end
|
@@ -97,7 +97,7 @@ describe Gitlab::CLI do
|
|
97
97
|
@output = capture_output { Gitlab::CLI.start(args) }
|
98
98
|
end
|
99
99
|
|
100
|
-
it "
|
100
|
+
it "shows user data with required fields" do
|
101
101
|
expect(@output).to include('id')
|
102
102
|
expect(@output).to include('name')
|
103
103
|
expect(@output).to include('email')
|
@@ -108,7 +108,7 @@ describe Gitlab::CLI do
|
|
108
108
|
end
|
109
109
|
|
110
110
|
context "fetch project with namespace/repo" do
|
111
|
-
it "
|
111
|
+
it "encodes delimiter" do
|
112
112
|
stub_get("/projects/gitlab-org%2Fgitlab-ce", "project")
|
113
113
|
args = ['project', 'gitlab-org/gitlab-ce']
|
114
114
|
@output = capture_output { Gitlab::CLI.start(args) }
|
@@ -5,14 +5,14 @@ describe Gitlab::Client do
|
|
5
5
|
context 'when issue award emojis' do
|
6
6
|
before do
|
7
7
|
stub_get("/projects/1/issues/80/award_emoji", "issue_award_emojis")
|
8
|
-
@emojis = Gitlab.award_emojis(1, 80, 'issue')
|
8
|
+
@emojis = Gitlab.award_emojis(1, 80, 'issue')
|
9
9
|
end
|
10
10
|
|
11
|
-
it "
|
11
|
+
it "gets the correct resources" do
|
12
12
|
expect(a_get("/projects/1/issues/80/award_emoji")).to have_been_made
|
13
13
|
end
|
14
14
|
|
15
|
-
it "
|
15
|
+
it "returns a paginated response of issue award emojis" do
|
16
16
|
expect(@emojis).to be_a Gitlab::PaginatedResponse
|
17
17
|
expect(@emojis.first.awardable_id).to eq(80)
|
18
18
|
expect(@emojis.first.awardable_type).to eq("Issue")
|
@@ -22,14 +22,14 @@ describe Gitlab::Client do
|
|
22
22
|
context 'when merge request award emojis' do
|
23
23
|
before do
|
24
24
|
stub_get("/projects/1/merge_requests/80/award_emoji", "merge_request_award_emojis")
|
25
|
-
@emojis = Gitlab.award_emojis(1, 80, 'merge_request')
|
25
|
+
@emojis = Gitlab.award_emojis(1, 80, 'merge_request')
|
26
26
|
end
|
27
27
|
|
28
|
-
it "
|
28
|
+
it "gets the correct resources" do
|
29
29
|
expect(a_get("/projects/1/merge_requests/80/award_emoji")).to have_been_made
|
30
30
|
end
|
31
31
|
|
32
|
-
it "
|
32
|
+
it "returns a paginated response of merge request award emojis" do
|
33
33
|
expect(@emojis).to be_a Gitlab::PaginatedResponse
|
34
34
|
expect(@emojis.first.awardable_id).to eq(80)
|
35
35
|
expect(@emojis.first.awardable_type).to eq("MergeRequest")
|
@@ -39,14 +39,14 @@ describe Gitlab::Client do
|
|
39
39
|
context 'when snippet award emojis' do
|
40
40
|
before do
|
41
41
|
stub_get("/projects/1/snippets/80/award_emoji", "snippet_award_emojis")
|
42
|
-
@emojis = Gitlab.award_emojis(1, 80, 'snippet')
|
42
|
+
@emojis = Gitlab.award_emojis(1, 80, 'snippet')
|
43
43
|
end
|
44
44
|
|
45
|
-
it "
|
45
|
+
it "gets the correct resources" do
|
46
46
|
expect(a_get("/projects/1/snippets/80/award_emoji")).to have_been_made
|
47
47
|
end
|
48
48
|
|
49
|
-
it "
|
49
|
+
it "returns a paginated response of snippet award emojis" do
|
50
50
|
expect(@emojis).to be_a Gitlab::PaginatedResponse
|
51
51
|
expect(@emojis.first.awardable_id).to eq(80)
|
52
52
|
expect(@emojis.first.awardable_type).to eq("Snippet")
|
@@ -58,14 +58,14 @@ describe Gitlab::Client do
|
|
58
58
|
context 'when issue note award emojis' do
|
59
59
|
before do
|
60
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)
|
61
|
+
@note_emojis = Gitlab.note_award_emojis(1, 80, 'issue', 1)
|
62
62
|
end
|
63
63
|
|
64
|
-
it "
|
64
|
+
it "gets the correct resources" do
|
65
65
|
expect(a_get("/projects/1/issues/80/notes/1/award_emoji")).to have_been_made
|
66
66
|
end
|
67
67
|
|
68
|
-
it "
|
68
|
+
it "returns a paginated response of issue note award emojis" do
|
69
69
|
expect(@note_emojis).to be_a Gitlab::PaginatedResponse
|
70
70
|
expect(@note_emojis.first.awardable_id).to eq(1)
|
71
71
|
expect(@note_emojis.first.awardable_type).to eq("Note")
|
@@ -75,14 +75,14 @@ describe Gitlab::Client do
|
|
75
75
|
context 'when merge request note award emojis' do
|
76
76
|
before do
|
77
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)
|
78
|
+
@note_emojis = Gitlab.note_award_emojis(1, 80, 'merge_request', 1)
|
79
79
|
end
|
80
80
|
|
81
|
-
it "
|
81
|
+
it "gets the correct resources" do
|
82
82
|
expect(a_get("/projects/1/merge_requests/80/notes/1/award_emoji")).to have_been_made
|
83
83
|
end
|
84
84
|
|
85
|
-
it "
|
85
|
+
it "returns a paginated response of merge request note award emojis" do
|
86
86
|
expect(@note_emojis).to be_a Gitlab::PaginatedResponse
|
87
87
|
expect(@note_emojis.first.awardable_id).to eq(1)
|
88
88
|
expect(@note_emojis.first.awardable_type).to eq("Note")
|
@@ -92,14 +92,14 @@ describe Gitlab::Client do
|
|
92
92
|
context 'when snippet note award emojis' do
|
93
93
|
before do
|
94
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)
|
95
|
+
@note_emojis = Gitlab.note_award_emojis(1, 80, 'snippet', 1)
|
96
96
|
end
|
97
97
|
|
98
|
-
it "
|
98
|
+
it "gets the correct resources" do
|
99
99
|
expect(a_get("/projects/1/snippets/80/notes/1/award_emoji")).to have_been_made
|
100
100
|
end
|
101
101
|
|
102
|
-
it "
|
102
|
+
it "returns a paginated response of snippet note award emojis" do
|
103
103
|
expect(@note_emojis).to be_a Gitlab::PaginatedResponse
|
104
104
|
expect(@note_emojis.first.awardable_id).to eq(1)
|
105
105
|
expect(@note_emojis.first.awardable_type).to eq("Note")
|
@@ -111,14 +111,14 @@ describe Gitlab::Client do
|
|
111
111
|
context 'when issue award emoji' do
|
112
112
|
before do
|
113
113
|
stub_get("/projects/1/issues/80/award_emoji/4", "issue_award_emoji")
|
114
|
-
@emoji = Gitlab.award_emoji(1, 80, 'issue', 4)
|
114
|
+
@emoji = Gitlab.award_emoji(1, 80, 'issue', 4)
|
115
115
|
end
|
116
116
|
|
117
|
-
it "
|
117
|
+
it "gets the correct resource" do
|
118
118
|
expect(a_get("/projects/1/issues/80/award_emoji/4")).to have_been_made
|
119
119
|
end
|
120
120
|
|
121
|
-
it "
|
121
|
+
it "returns information about an issue award emoji" do
|
122
122
|
expect(@emoji.id).to eq(4)
|
123
123
|
expect(@emoji.awardable_type).to eq("Issue")
|
124
124
|
expect(@emoji.awardable_id).to eq(80)
|
@@ -128,14 +128,14 @@ describe Gitlab::Client do
|
|
128
128
|
context 'when merge request award emoji' do
|
129
129
|
before do
|
130
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)
|
131
|
+
@emoji = Gitlab.award_emoji(1, 80, 'merge_request', 4)
|
132
132
|
end
|
133
133
|
|
134
|
-
it "
|
134
|
+
it "gets the correct resource" do
|
135
135
|
expect(a_get("/projects/1/merge_requests/80/award_emoji/4")).to have_been_made
|
136
136
|
end
|
137
137
|
|
138
|
-
it "
|
138
|
+
it "returns information about a merge request award emoji" do
|
139
139
|
expect(@emoji.id).to eq(4)
|
140
140
|
expect(@emoji.awardable_type).to eq("MergeRequest")
|
141
141
|
expect(@emoji.awardable_id).to eq(80)
|
@@ -145,14 +145,14 @@ describe Gitlab::Client do
|
|
145
145
|
context 'when snippet award emoji' do
|
146
146
|
before do
|
147
147
|
stub_get("/projects/1/snippets/80/award_emoji/4", "snippet_award_emoji")
|
148
|
-
@emoji = Gitlab.award_emoji(1, 80, 'snippet', 4)
|
148
|
+
@emoji = Gitlab.award_emoji(1, 80, 'snippet', 4)
|
149
149
|
end
|
150
150
|
|
151
|
-
it "
|
151
|
+
it "gets the correct resource" do
|
152
152
|
expect(a_get("/projects/1/snippets/80/award_emoji/4")).to have_been_made
|
153
153
|
end
|
154
154
|
|
155
|
-
it "
|
155
|
+
it "returns information about a snippet award emoji" do
|
156
156
|
expect(@emoji.id).to eq(4)
|
157
157
|
expect(@emoji.awardable_type).to eq("Snippet")
|
158
158
|
expect(@emoji.awardable_id).to eq(80)
|
@@ -164,14 +164,14 @@ describe Gitlab::Client do
|
|
164
164
|
context 'when issue note award emoji' do
|
165
165
|
before do
|
166
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)
|
167
|
+
@note_emoji = Gitlab.note_award_emoji(1, 80, 'issue', 1, 4)
|
168
168
|
end
|
169
169
|
|
170
|
-
it "
|
170
|
+
it "gets the correct resource" do
|
171
171
|
expect(a_get("/projects/1/issues/80/notes/1/award_emoji/4")).to have_been_made
|
172
172
|
end
|
173
173
|
|
174
|
-
it "
|
174
|
+
it "returns information about an issue note award emoji" do
|
175
175
|
expect(@note_emoji.id).to eq(4)
|
176
176
|
expect(@note_emoji.awardable_type).to eq("Note")
|
177
177
|
expect(@note_emoji.awardable_id).to eq(1)
|
@@ -181,14 +181,14 @@ describe Gitlab::Client do
|
|
181
181
|
context 'when merge request note award emoji' do
|
182
182
|
before do
|
183
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)
|
184
|
+
@note_emoji = Gitlab.note_award_emoji(1, 80, 'merge_request', 1, 4)
|
185
185
|
end
|
186
186
|
|
187
|
-
it "
|
187
|
+
it "gets the correct resource" do
|
188
188
|
expect(a_get("/projects/1/merge_requests/80/notes/1/award_emoji/4")).to have_been_made
|
189
189
|
end
|
190
190
|
|
191
|
-
it "
|
191
|
+
it "returns information about a merge request note award emoji" do
|
192
192
|
expect(@note_emoji.id).to eq(4)
|
193
193
|
expect(@note_emoji.awardable_type).to eq("Note")
|
194
194
|
expect(@note_emoji.awardable_id).to eq(1)
|
@@ -198,14 +198,14 @@ describe Gitlab::Client do
|
|
198
198
|
context 'when snippet note award emoji' do
|
199
199
|
before do
|
200
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)
|
201
|
+
@note_emoji = Gitlab.note_award_emoji(1, 80, 'snippet', 1, 4)
|
202
202
|
end
|
203
203
|
|
204
|
-
it "
|
204
|
+
it "gets the correct resource" do
|
205
205
|
expect(a_get("/projects/1/snippets/80/notes/1/award_emoji/4")).to have_been_made
|
206
206
|
end
|
207
207
|
|
208
|
-
it "
|
208
|
+
it "returns information about a snippet note award emoji" do
|
209
209
|
expect(@note_emoji.id).to eq(4)
|
210
210
|
expect(@note_emoji.awardable_type).to eq("Note")
|
211
211
|
expect(@note_emoji.awardable_id).to eq(1)
|
@@ -220,12 +220,12 @@ describe Gitlab::Client do
|
|
220
220
|
@emoji = Gitlab.create_award_emoji(1, 80, "issue", "blowfish")
|
221
221
|
end
|
222
222
|
|
223
|
-
it "
|
223
|
+
it "gets the correct resource" do
|
224
224
|
expect(a_post("/projects/1/issues/80/award_emoji").
|
225
225
|
with(body: { name: 'blowfish' })).to have_been_made
|
226
226
|
end
|
227
227
|
|
228
|
-
it "
|
228
|
+
it "returns correct information about the created issue award emoji" do
|
229
229
|
expect(@emoji.name).to eq('blowfish')
|
230
230
|
expect(@emoji.awardable_type).to eq('Issue')
|
231
231
|
end
|
@@ -237,12 +237,12 @@ describe Gitlab::Client do
|
|
237
237
|
@emoji = Gitlab.create_award_emoji(1, 80, "merge_request", "blowfish")
|
238
238
|
end
|
239
239
|
|
240
|
-
it "
|
240
|
+
it "gets the correct resource" do
|
241
241
|
expect(a_post("/projects/1/merge_requests/80/award_emoji").
|
242
242
|
with(body: { name: 'blowfish' })).to have_been_made
|
243
243
|
end
|
244
244
|
|
245
|
-
it "
|
245
|
+
it "returns correct information about the created merge request award emoji" do
|
246
246
|
expect(@emoji.name).to eq('blowfish')
|
247
247
|
expect(@emoji.awardable_type).to eq('MergeRequest')
|
248
248
|
end
|
@@ -254,12 +254,12 @@ describe Gitlab::Client do
|
|
254
254
|
@emoji = Gitlab.create_award_emoji(1, 80, "snippet", "blowfish")
|
255
255
|
end
|
256
256
|
|
257
|
-
it "
|
257
|
+
it "gets the correct resource" do
|
258
258
|
expect(a_post("/projects/1/snippets/80/award_emoji").
|
259
259
|
with(body: { name: 'blowfish' })).to have_been_made
|
260
260
|
end
|
261
261
|
|
262
|
-
it "
|
262
|
+
it "returns correct information about the created snippet award emoji" do
|
263
263
|
expect(@emoji.name).to eq('blowfish')
|
264
264
|
expect(@emoji.awardable_type).to eq('Snippet')
|
265
265
|
end
|
@@ -273,12 +273,12 @@ describe Gitlab::Client do
|
|
273
273
|
@note_emoji = Gitlab.create_note_award_emoji(1, 80, "issue", 1, "mood_bubble_lightning")
|
274
274
|
end
|
275
275
|
|
276
|
-
it "
|
276
|
+
it "gets the correct resource" do
|
277
277
|
expect(a_post("/projects/1/issues/80/notes/1/award_emoji").
|
278
278
|
with(body: { name: 'mood_bubble_lightning' })).to have_been_made
|
279
279
|
end
|
280
280
|
|
281
|
-
it "
|
281
|
+
it "returns correct information about the created issue note award emoji" do
|
282
282
|
expect(@note_emoji.name).to eq('mood_bubble_lightning')
|
283
283
|
expect(@note_emoji.awardable_type).to eq('Note')
|
284
284
|
end
|
@@ -290,12 +290,12 @@ describe Gitlab::Client do
|
|
290
290
|
@note_emoji = Gitlab.create_note_award_emoji(1, 80, "merge_request", 1, "mood_bubble_lightning")
|
291
291
|
end
|
292
292
|
|
293
|
-
it "
|
293
|
+
it "gets the correct resource" do
|
294
294
|
expect(a_post("/projects/1/merge_requests/80/notes/1/award_emoji").
|
295
295
|
with(body: { name: 'mood_bubble_lightning' })).to have_been_made
|
296
296
|
end
|
297
297
|
|
298
|
-
it "
|
298
|
+
it "returns correct information about the created merge request note award emoji" do
|
299
299
|
expect(@note_emoji.name).to eq('mood_bubble_lightning')
|
300
300
|
expect(@note_emoji.awardable_type).to eq('Note')
|
301
301
|
end
|
@@ -307,12 +307,12 @@ describe Gitlab::Client do
|
|
307
307
|
@note_emoji = Gitlab.create_note_award_emoji(1, 80, "snippet", 1, "mood_bubble_lightning")
|
308
308
|
end
|
309
309
|
|
310
|
-
it "
|
310
|
+
it "gets the correct resource" do
|
311
311
|
expect(a_post("/projects/1/snippets/80/notes/1/award_emoji").
|
312
312
|
with(body: { name: 'mood_bubble_lightning' })).to have_been_made
|
313
313
|
end
|
314
314
|
|
315
|
-
it "
|
315
|
+
it "returns correct information about the created snippet note award emoji" do
|
316
316
|
expect(@note_emoji.name).to eq('mood_bubble_lightning')
|
317
317
|
expect(@note_emoji.awardable_type).to eq('Note')
|
318
318
|
end
|
@@ -326,7 +326,7 @@ describe Gitlab::Client do
|
|
326
326
|
@emoji = Gitlab.delete_award_emoji(1, 80, "issue", 4)
|
327
327
|
end
|
328
328
|
|
329
|
-
it "
|
329
|
+
it "gets the correct resource" do
|
330
330
|
expect(a_delete("/projects/1/issues/80/award_emoji/4")).to have_been_made
|
331
331
|
end
|
332
332
|
end
|
@@ -337,7 +337,7 @@ describe Gitlab::Client do
|
|
337
337
|
@emoji = Gitlab.delete_award_emoji(1, 80, "merge_request", 4)
|
338
338
|
end
|
339
339
|
|
340
|
-
it "
|
340
|
+
it "gets the correct resource" do
|
341
341
|
expect(a_delete("/projects/1/merge_requests/80/award_emoji/4")).to have_been_made
|
342
342
|
end
|
343
343
|
end
|
@@ -348,7 +348,7 @@ describe Gitlab::Client do
|
|
348
348
|
@emoji = Gitlab.delete_award_emoji(1, 80, "snippet", 4)
|
349
349
|
end
|
350
350
|
|
351
|
-
it "
|
351
|
+
it "gets the correct resource" do
|
352
352
|
expect(a_delete("/projects/1/snippets/80/award_emoji/4")).to have_been_made
|
353
353
|
end
|
354
354
|
end
|
@@ -361,7 +361,7 @@ describe Gitlab::Client do
|
|
361
361
|
@note_emoji = Gitlab.delete_note_award_emoji(1, 80, "issue", 1, 4)
|
362
362
|
end
|
363
363
|
|
364
|
-
it "
|
364
|
+
it "gets the correct resource" do
|
365
365
|
expect(a_delete("/projects/1/issues/80/notes/1/award_emoji/4")).to have_been_made
|
366
366
|
end
|
367
367
|
end
|
@@ -372,7 +372,7 @@ describe Gitlab::Client do
|
|
372
372
|
@note_emoji = Gitlab.delete_note_award_emoji(1, 80, "merge_request", 1, 4)
|
373
373
|
end
|
374
374
|
|
375
|
-
it "
|
375
|
+
it "gets the correct resource" do
|
376
376
|
expect(a_delete("/projects/1/merge_requests/80/notes/1/award_emoji/4")).to have_been_made
|
377
377
|
end
|
378
378
|
end
|
@@ -383,9 +383,9 @@ describe Gitlab::Client do
|
|
383
383
|
@note_emoji = Gitlab.delete_note_award_emoji(1, 80, "snippet", 1, 4)
|
384
384
|
end
|
385
385
|
|
386
|
-
it "
|
386
|
+
it "gets the correct resource" do
|
387
387
|
expect(a_delete("/projects/1/snippets/80/notes/1/award_emoji/4")).to have_been_made
|
388
388
|
end
|
389
389
|
end
|
390
390
|
end
|
391
|
-
end
|
391
|
+
end
|