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: a5909cb3641c879372c0c98ea0e1535d948a1273
4
- data.tar.gz: e89f483cd5935228006a8069ad637c363d04e654
3
+ metadata.gz: edf960f896f8e18b401c335434c5f7bfc78a5de9
4
+ data.tar.gz: c23ee134b16b4a8698e17106e8c7981c8aa5e1b6
5
5
  SHA512:
6
- metadata.gz: a08685ea16c0972db7bbf463e092fa4d7b92e17c9637c2a01261383932206d77de6801b393bb435ae6812bab37dd4e853cb6db5c71e5d1f4011dc00090b21f4d
7
- data.tar.gz: 9981e7535f62faf0eb3e3bd5879e0242777cbaaed86e08151f5d8a820bd3009518927b4ded6990a6e5ab240f50b1a973414316fa0fef49ef0745930ceb564440
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 @new_count > 0 && @fixed_count > 0
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)}"
@@ -1,5 +1,5 @@
1
1
  module CC
2
2
  module Services
3
- VERSION = "1.9.4".freeze
3
+ VERSION = "1.9.5".freeze
4
4
  end
5
5
  end
@@ -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
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: