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 +4 -4
- data/lib/rock_rms/resources/phone_number.rb +12 -0
- data/lib/rock_rms/response/phone_number.rb +1 -0
- data/lib/rock_rms/version.rb +1 -1
- data/spec/rock_rms/resources/phone_number_spec.rb +43 -0
- data/spec/support/fixtures/create_phone_number.json +1 -0
- data/spec/support/rock_mock.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af52845417f3c9703934306000099a7c92265be8
|
4
|
+
data.tar.gz: f48c7c557a0d54ce6d647eac80c3876ba35c0115
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
data/lib/rock_rms/version.rb
CHANGED
@@ -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
|
|
@@ -0,0 +1 @@
|
|
1
|
+
12345
|
data/spec/support/rock_mock.rb
CHANGED
@@ -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.
|
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-
|
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
|