capsule_crm 1.5.3 → 1.6.0

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: 8e7405598f0066a5e3cd37b3ec6f2bd8439a6dd6
4
- data.tar.gz: 40795732dd03c2421f124210a156566bc83b7577
3
+ metadata.gz: d1edcdd8d69a89209c63296cadd8ce24ca016d61
4
+ data.tar.gz: c8ea9420994ff54c71967c48feac9ad63087065d
5
5
  SHA512:
6
- metadata.gz: 48cd1bd25e778753423acff294711e295a1c72a0aae39f2ae4dff4545cc62896760bd41a405c78ce7365f71c97b65de409ca737e8c9322fbaa970e4489eeecc4
7
- data.tar.gz: 122894fd877dd1c63b9e6d78d74d4a152a70bdde22dc4f792290a87197419c4e1ed08b32bee772e37035c065a3f3229e03df0e00376e742b130f71efdfab916b
6
+ metadata.gz: 7e8ef70a7bbc1a6fc40ae099617b4924eddc1dd5075ed30ede8fdb4a14ca5cb1e29e50114619dd02db62238ca59d4b40ba50da613a90c2dabdfcedfc68a987da
7
+ data.tar.gz: 8c0a324a128c47f696d8f46ce1c124994bd3c5bdae9ed3722b43d74f6b76dcff500b4b3dc8479439670c6c362e0cff152a1f460c41c791a46c7fe02779ee2d6a
@@ -6,6 +6,10 @@ module CapsuleCRM
6
6
  def initialize(response)
7
7
  @response = response
8
8
  end
9
+
10
+ def to_s
11
+ JSON.parse(response.body)['message']
12
+ end
9
13
  end
10
14
  end
11
15
  end
@@ -1,3 +1,3 @@
1
1
  module CapsuleCrm
2
- VERSION = '1.5.3'
2
+ VERSION = '1.6.0'
3
3
  end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ describe CapsuleCRM::Errors::ResponseError do
4
+ describe '#to_s' do
5
+ let(:response) { double('Response', body: response_body.to_json) }
6
+ let(:response_body) do
7
+ { message: 'this is an error message from the server' }
8
+ end
9
+ let(:error) { CapsuleCRM::Errors::ResponseError.new(response) }
10
+
11
+ subject { error.to_s }
12
+
13
+ it 'should include the server error message' do
14
+ expect(subject).to eql(response_body[:message])
15
+ end
16
+ end
17
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capsule_crm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.3
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Beedle
@@ -332,6 +332,7 @@ files:
332
332
  - spec/lib/capsule_crm/custom_field_definition_spec.rb
333
333
  - spec/lib/capsule_crm/custom_field_spec.rb
334
334
  - spec/lib/capsule_crm/email_spec.rb
335
+ - spec/lib/capsule_crm/errors/response_error_spec.rb
335
336
  - spec/lib/capsule_crm/history_spec.rb
336
337
  - spec/lib/capsule_crm/milestone_spec.rb
337
338
  - spec/lib/capsule_crm/normalizer_spec.rb
@@ -440,6 +441,7 @@ test_files:
440
441
  - spec/lib/capsule_crm/custom_field_definition_spec.rb
441
442
  - spec/lib/capsule_crm/custom_field_spec.rb
442
443
  - spec/lib/capsule_crm/email_spec.rb
444
+ - spec/lib/capsule_crm/errors/response_error_spec.rb
443
445
  - spec/lib/capsule_crm/history_spec.rb
444
446
  - spec/lib/capsule_crm/milestone_spec.rb
445
447
  - spec/lib/capsule_crm/normalizer_spec.rb