rock_rms 4.12.3 → 4.13.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: e76ed6931e3e3ba5413bffaf4b69bec21f092cbf
4
- data.tar.gz: 9bd81c05db0db677b8146f71be4a655d654f5154
3
+ metadata.gz: af52845417f3c9703934306000099a7c92265be8
4
+ data.tar.gz: f48c7c557a0d54ce6d647eac80c3876ba35c0115
5
5
  SHA512:
6
- metadata.gz: 275b494aeb227aa922ba6571c74c29604350b882c02b0b65059e23cdd10aad21a10def601ed09b099cdb51c6f996b3cbd4c27487b07fa458b0549ee3d6b20c88
7
- data.tar.gz: 5453d5327af4ae699e29e942ef53457f70981f2de4e910435d068e8002a8ffb64810d066452f3e188c402949af8fd20826fe4bbb1cece6763b2b3a426eba4de6
6
+ metadata.gz: cba18b60ba14d7337d805a678d10c2cd71d03f4b700d6c354c0ffc984ada31a37fd47922ffa2d4000956e5002dfcde6d77b68f628efb7e0d08e9846b6c6bfe41
7
+ data.tar.gz: d461f2a7bac6f5549a9b6ab70caa520d9d73172e0d949bc0e49c89e80bc54e6e812f1c374edf11115b0c7fcef55a36eaeb1d4b3f80c08c5e3560890b9d9344ad
@@ -5,6 +5,18 @@ module RockRMS
5
5
  Response::PhoneNumber.format(get(phone_number_path, options))
6
6
  end
7
7
 
8
+ def create_phone_number(number_type_value_id:, number:, person_id:)
9
+ options = {
10
+ 'IsSystem' => true,
11
+ 'IsMessagingEnabled' => false,
12
+ 'NumberTypeValueId' => number_type_value_id,
13
+ 'Number' => number,
14
+ 'PersonId' => person_id
15
+ }
16
+
17
+ post(phone_number_path, options)
18
+ end
19
+
8
20
  private
9
21
 
10
22
  def phone_number_path(id = nil)
@@ -5,6 +5,7 @@ module RockRMS
5
5
  id: 'Id',
6
6
  person_id: 'PersonId',
7
7
  number: 'Number',
8
+ number_type_value_id: 'NumberTypeValueId',
8
9
  formatted: 'NumberFormatted',
9
10
  formatted_with_cc: 'NumberFormattedWithCountryCode'
10
11
  }.freeze
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '4.12.3'.freeze
2
+ VERSION = '4.13.0'.freeze
3
3
  end
@@ -3,6 +3,49 @@ require 'spec_helper'
3
3
  RSpec.describe RockRMS::Client::PhoneNumber, type: :model do
4
4
  include_context 'resource specs'
5
5
 
6
+ describe '#create_phone_number' do
7
+ context 'arguments' do
8
+ subject { client.create_phone_number }
9
+
10
+ it 'requires `number_type_value_id`' do
11
+ expect { subject }.to raise_error(ArgumentError, /number_type_value_id/)
12
+ end
13
+
14
+ it 'requires `number`' do
15
+ expect { subject }.to raise_error(ArgumentError, /number/)
16
+ end
17
+
18
+ it 'requires `person_id`' do
19
+ expect { subject }.to raise_error(ArgumentError, /person_id/)
20
+ end
21
+ end
22
+
23
+ subject(:resource) do
24
+ client.create_phone_number(
25
+ number_type_value_id: 13,
26
+ number: '5555555555',
27
+ person_id: 1
28
+ )
29
+ end
30
+
31
+ it 'returns an integer' do
32
+ expect(resource).to be_a(Integer)
33
+ end
34
+
35
+ it 'passes options' do
36
+ expect(client).to receive(:post)
37
+ .with(
38
+ 'PhoneNumbers',
39
+ 'IsSystem' => true,
40
+ 'IsMessagingEnabled' => false,
41
+ 'NumberTypeValueId' => 13,
42
+ 'Number' => '5555555555',
43
+ 'PersonId' => 1
44
+ ).and_call_original
45
+ resource
46
+ end
47
+ end
48
+
6
49
  describe '#list_phone_numbers(options = {})' do
7
50
  subject(:resource) { client.list_phone_numbers }
8
51
 
@@ -59,6 +59,7 @@ class RockMock < Sinatra::Base
59
59
  create_group_member: 'GroupMembers',
60
60
  create_transaction: 'FinancialTransactions',
61
61
  create_payment_detail: 'FinancialPaymentDetails',
62
+ create_phone_number: 'PhoneNumbers',
62
63
  create_batch: 'FinancialBatches',
63
64
  create_recurring_donation: 'FinancialScheduledTransactions',
64
65
  create_refund: 'FinancialTransactionRefunds',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rock_rms
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.12.3
4
+ version: 4.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-05 00:00:00.000000000 Z
11
+ date: 2019-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -290,6 +290,7 @@ files:
290
290
  - spec/support/fixtures/create_batch.json
291
291
  - spec/support/fixtures/create_group_member.json
292
292
  - spec/support/fixtures/create_payment_detail.json
293
+ - spec/support/fixtures/create_phone_number.json
293
294
  - spec/support/fixtures/create_recurring_donation.json
294
295
  - spec/support/fixtures/create_refund.json
295
296
  - spec/support/fixtures/create_refund_reason.json