codeclimate-services 1.9.4 → 1.9.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edf960f896f8e18b401c335434c5f7bfc78a5de9
|
4
|
+
data.tar.gz: c23ee134b16b4a8698e17106e8c7981c8aa5e1b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89c6091c8a036e7e28937e3375b5558d7cb119be4586b95499c76eeda829efaf4d9be209a5e38958a4c255c0eb7c0e7ef4edef8bad7b36ebba61724643f7fe16
|
7
|
+
data.tar.gz: 5669440d317e738069ad307872c56ce220929a37bde4bf14110c9fdb9fce9a016fe27b96a4078ff01b462da04b96a1ec3f622a3739ab6fb9a14d2b708ed50f8a
|
@@ -13,6 +13,12 @@ module CC
|
|
13
13
|
|
14
14
|
@covered_percent = payload["covered_percent"]
|
15
15
|
@covered_percent_delta = payload["covered_percent_delta"]
|
16
|
+
|
17
|
+
@approved_by = payload["approved_by"].presence
|
18
|
+
end
|
19
|
+
|
20
|
+
def approved_message
|
21
|
+
"Approved by #{@approved_by}."
|
16
22
|
end
|
17
23
|
|
18
24
|
def error_message
|
@@ -40,7 +46,9 @@ module CC
|
|
40
46
|
end
|
41
47
|
|
42
48
|
def success_message
|
43
|
-
if @
|
49
|
+
if @approved_by
|
50
|
+
approved_message
|
51
|
+
elsif @new_count > 0 && @fixed_count > 0
|
44
52
|
"#{@new_count} new #{"issue".pluralize(@new_count)} (#{@fixed_count} fixed)"
|
45
53
|
elsif @new_count <= 0 && @fixed_count > 0
|
46
54
|
"#{@fixed_count} fixed #{"issue".pluralize(@fixed_count)}"
|
data/lib/cc/services/version.rb
CHANGED
@@ -38,6 +38,16 @@ describe CC::Service::PullRequestsPresenter, type: :service do
|
|
38
38
|
expect("85.35% (-3%)").to eq( build_presenter({}, "covered_percent" => 85.348, "covered_percent_delta" => -3.0).coverage_message)
|
39
39
|
end
|
40
40
|
|
41
|
+
it "message approved" do
|
42
|
+
expect(build_presenter({"fixed" => 1, "new" => 1}, { "approved_by" => "FooBar"}).success_message).
|
43
|
+
to eq("Approved by FooBar.")
|
44
|
+
end
|
45
|
+
|
46
|
+
it "message approved is empty string" do
|
47
|
+
expect(build_presenter({"fixed" => 1, "new" => 1}, { "approved_by" => ""}).success_message).
|
48
|
+
to eq("1 new issue (1 fixed)")
|
49
|
+
end
|
50
|
+
|
41
51
|
private
|
42
52
|
|
43
53
|
def build_payload(issue_counts)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeclimate-services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Helmkamp
|
@@ -268,3 +268,4 @@ test_files:
|
|
268
268
|
- spec/support/fake_logger.rb
|
269
269
|
- spec/support/resolv_helpers.rb
|
270
270
|
- spec/support/service_context.rb
|
271
|
+
has_rdoc:
|