rock_rms 9.9.0 → 9.10.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/client.rb +3 -0
- data/lib/rock_rms/resources/content_channel.rb +31 -0
- data/lib/rock_rms/resources/content_channel_item.rb +10 -0
- data/lib/rock_rms/resources/content_channel_type.rb +11 -0
- data/lib/rock_rms/response/base.rb +2 -1
- data/lib/rock_rms/response/batch.rb +1 -2
- data/lib/rock_rms/response/content_channel.rb +17 -0
- data/lib/rock_rms/response/content_channel_item.rb +18 -0
- data/lib/rock_rms/response/content_channel_type.rb +13 -0
- data/lib/rock_rms/response/payment_detail.rb +0 -1
- data/lib/rock_rms/response/recurring_donation.rb +0 -1
- data/lib/rock_rms/response/saved_payment_method.rb +0 -1
- data/lib/rock_rms/response/system_communication.rb +0 -1
- data/lib/rock_rms/response/system_email.rb +1 -2
- data/lib/rock_rms/version.rb +1 -1
- data/spec/rock_rms/resources/content_channel_item_spec.rb +14 -0
- data/spec/rock_rms/resources/content_channel_spec.rb +47 -0
- data/spec/rock_rms/resources/content_channel_type_spec.rb +14 -0
- data/spec/rock_rms/response/attribute_value_spec.rb +3 -2
- data/spec/rock_rms/response/content_channel_item_spec.rb +33 -0
- data/spec/rock_rms/response/content_channel_spec.rb +32 -0
- data/spec/rock_rms/response/content_channel_type_spec.rb +27 -0
- data/spec/rock_rms/response/defined_value_spec.rb +1 -1
- data/spec/rock_rms/response/recurring_donation_spec.rb +1 -1
- data/spec/support/fixtures/content_channel.json +13 -0
- data/spec/support/fixtures/content_channel_item.json +5 -0
- data/spec/support/fixtures/content_channel_items.json +6 -0
- data/spec/support/fixtures/content_channel_type.json +4 -0
- data/spec/support/fixtures/content_channel_types.json +6 -0
- data/spec/support/fixtures/content_channels.json +15 -0
- data/spec/support/rock_mock.rb +7 -0
- metadata +20 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2640ca0dcf3e580eeade6f3745d22b86e29b0661972435f169d6897735f3521c
|
4
|
+
data.tar.gz: 07f00ea4b81a9e1eb04506b5b74534635bdbb6e6ef9728eaeb0793e4b6c8200b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73bde19a21af8a8730ecd2754aadc247d30e7fff5cec112ca89cd7c9bd13dc78257e3a122086a1f005f432ae77672715a27abf318a34259301d15383c8b69cf2
|
7
|
+
data.tar.gz: c4fef3cc6e8970f1e858fc2c2b375f997b5d643c8168d0b148c4b835a609c10e7b8ef9beed0983789d34e73ce6f7164e1a6762008b130899ef18a36cee37bccb
|
data/lib/rock_rms/client.rb
CHANGED
@@ -19,6 +19,9 @@ module RockRMS
|
|
19
19
|
include RockRMS::Client::BlockType
|
20
20
|
include RockRMS::Client::Fund
|
21
21
|
include RockRMS::Client::Campus
|
22
|
+
include RockRMS::Client::ContentChannel
|
23
|
+
include RockRMS::Client::ContentChannelType
|
24
|
+
include RockRMS::Client::ContentChannelItem
|
22
25
|
include RockRMS::Client::DefinedType
|
23
26
|
include RockRMS::Client::DefinedValue
|
24
27
|
include RockRMS::Client::ExceptionLog
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module RockRMS
|
2
|
+
class Client
|
3
|
+
module ContentChannel
|
4
|
+
def list_content_channels(options = {})
|
5
|
+
res = get(content_channel_path, options)
|
6
|
+
Response::ContentChannel.format(res)
|
7
|
+
end
|
8
|
+
|
9
|
+
def find_content_channel(id)
|
10
|
+
res = get(content_channel_path(id))
|
11
|
+
Response::ContentChannel.format(res)
|
12
|
+
end
|
13
|
+
|
14
|
+
def update_content_channel(
|
15
|
+
id:,
|
16
|
+
foreign_key: nil
|
17
|
+
)
|
18
|
+
options = { foreign_key: foreign_key }.compact
|
19
|
+
|
20
|
+
patch(content_channel_path(id), options)
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def content_channel_path(id = nil)
|
26
|
+
id ? "ContentChannels/#{id}" : 'ContentChannels'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
@@ -10,7 +10,8 @@ module RockRMS
|
|
10
10
|
modified_date_time: 'ModifiedDateTime',
|
11
11
|
created_by_person_alias_id: 'CreatedByPersonAliasId',
|
12
12
|
attributes: 'Attributes',
|
13
|
-
attribute_values: 'AttributeValues'
|
13
|
+
attribute_values: 'AttributeValues',
|
14
|
+
foreign_key: 'ForeignKey'
|
14
15
|
}.freeze
|
15
16
|
|
16
17
|
def self.format(data)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module RockRMS
|
2
|
+
module Response
|
3
|
+
class ContentChannel < Base
|
4
|
+
MAP = {
|
5
|
+
name: 'Name',
|
6
|
+
description: 'Description',
|
7
|
+
is_active: 'IsActive',
|
8
|
+
icon_css_class: 'IconCssClass',
|
9
|
+
content_channel_type_id: 'ContentChannelTypeId'
|
10
|
+
}.freeze
|
11
|
+
|
12
|
+
def format_single(data)
|
13
|
+
to_h(MAP, data)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module RockRMS
|
2
|
+
module Response
|
3
|
+
class ContentChannelItem < Base
|
4
|
+
MAP = {
|
5
|
+
content_channel_id: 'ContentChannelId',
|
6
|
+
title: 'Title',
|
7
|
+
content: 'Content',
|
8
|
+
order: 'Order',
|
9
|
+
start_date: 'StartDateTime',
|
10
|
+
expire_date: 'ExpireDateTime',
|
11
|
+
}
|
12
|
+
|
13
|
+
def format_single(data)
|
14
|
+
to_h(MAP, data)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/rock_rms/version.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe RockRMS::Client::ContentChannelType, type: :model do
|
4
|
+
include_context 'resource specs'
|
5
|
+
|
6
|
+
describe '#list_content_channel_types(options = {})' do
|
7
|
+
it 'returns a list of content channel types' do
|
8
|
+
result = client.list_content_channel_types
|
9
|
+
expect(result).to be_an(Array)
|
10
|
+
expect(result.first).to have_key(:id)
|
11
|
+
expect(result.first).to have_key(:name)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe RockRMS::Client::ContentChannel, type: :model do
|
4
|
+
include_context 'resource specs'
|
5
|
+
|
6
|
+
describe '#list_content_channels(options = {})' do
|
7
|
+
it 'returns a list of content channels' do
|
8
|
+
result = client.list_content_channels
|
9
|
+
expect(result).to be_an(Array)
|
10
|
+
expect(result.first).to have_key(:id)
|
11
|
+
expect(result.first).to have_key(:name)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '#find_content_channel(id)' do
|
16
|
+
it 'returns a hash' do
|
17
|
+
expect(client.find_content_channel(123)).to be_a(Hash)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'queries' do
|
21
|
+
expect(client).to receive(:get).with('ContentChannels/123')
|
22
|
+
.and_call_original
|
23
|
+
|
24
|
+
resource = client.find_content_channel(123)
|
25
|
+
|
26
|
+
expect(resource[:id]).to eq(345)
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'formats with ContentChannel' do
|
30
|
+
response = double
|
31
|
+
expect(RockRMS::Response::ContentChannel).to receive(:format).with(response)
|
32
|
+
allow(client).to receive(:get).and_return(response)
|
33
|
+
client.find_content_channel(123)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe '#update_content_channel' do
|
38
|
+
it 'does not raise error' do
|
39
|
+
expect { client.update_content_channel(id: 123) }.not_to raise_error
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'sends a patch request' do
|
43
|
+
expect(client).to receive(:patch).with('ContentChannels/123', { foreign_key: 3925 })
|
44
|
+
client.update_content_channel(id: 123, foreign_key: 3925)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe RockRMS::Client::ContentChannelType, type: :model do
|
4
|
+
include_context 'resource specs'
|
5
|
+
|
6
|
+
describe '#list_content_channel_types(options = {})' do
|
7
|
+
it 'returns a list of content channel types' do
|
8
|
+
result = client.list_content_channel_types
|
9
|
+
expect(result).to be_an(Array)
|
10
|
+
expect(result.first).to have_key(:id)
|
11
|
+
expect(result.first).to have_key(:name)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -14,7 +14,7 @@ RSpec.describe RockRMS::Response::AttributeValue, type: :model do
|
|
14
14
|
|
15
15
|
it 'has the correct number keys' do
|
16
16
|
keys = result.first.keys
|
17
|
-
expect(keys.count).to eq(
|
17
|
+
expect(keys.count).to eq(13)
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'translates keys' do
|
@@ -32,11 +32,12 @@ RSpec.describe RockRMS::Response::AttributeValue, type: :model do
|
|
32
32
|
created_date_time: nil,
|
33
33
|
description: nil,
|
34
34
|
entity_type_id: 7,
|
35
|
+
foreign_key: nil,
|
35
36
|
guid: "abcd",
|
36
37
|
id: 22,
|
37
38
|
key: "JobPulse",
|
38
39
|
modified_date_time: nil,
|
39
|
-
name: "Job Pulse"
|
40
|
+
name: "Job Pulse",
|
40
41
|
})
|
41
42
|
end
|
42
43
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe RockRMS::Response::ContentChannelItem, type: :model do
|
4
|
+
let(:parsed) { JSON.parse(FixturesHelper.read('content_channel_items.json')) }
|
5
|
+
|
6
|
+
describe '.format' do
|
7
|
+
subject(:result) { described_class.format(parsed) }
|
8
|
+
|
9
|
+
context 'when response is array' do
|
10
|
+
it 'returns an array' do
|
11
|
+
expect(described_class.format([])).to be_a(Array)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'has the correct number keys' do
|
16
|
+
keys = result.first.keys
|
17
|
+
expect(keys.count).to eq(14)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'translates keys' do
|
21
|
+
result.zip(parsed) do |r, p|
|
22
|
+
expect(r[:id]).to eq(p['Id'])
|
23
|
+
expect(r[:foreign_key]).to eq(p['ForeignKey'])
|
24
|
+
expect(r[:content_channel_id]).to eq(p['ContentChannelId'])
|
25
|
+
expect(r[:title]).to eq(p['Title'])
|
26
|
+
expect(r[:content]).to eq(p['Content'])
|
27
|
+
expect(r[:order]).to eq(p['Order'])
|
28
|
+
expect(r[:start_date]).to eq(p['StartDateTime'])
|
29
|
+
expect(r[:expire_date]).to eq(p['ExpireDateTime'])
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe RockRMS::Response::ContentChannel, type: :model do
|
4
|
+
let(:parsed) { JSON.parse(FixturesHelper.read('content_channels.json')) }
|
5
|
+
|
6
|
+
describe '.format' do
|
7
|
+
subject(:result) { described_class.format(parsed) }
|
8
|
+
|
9
|
+
context 'when response is array' do
|
10
|
+
it 'returns an array' do
|
11
|
+
expect(described_class.format([])).to be_a(Array)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'has the correct number keys' do
|
16
|
+
keys = result.first.keys
|
17
|
+
expect(keys.count).to eq(13)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'translates keys' do
|
21
|
+
result.zip(parsed) do |r, p|
|
22
|
+
expect(r[:id]).to eq(p['Id'])
|
23
|
+
expect(r[:foreign_key]).to eq(p['ForeignKey'])
|
24
|
+
expect(r[:name]).to eq(p['Name'])
|
25
|
+
expect(r[:description]).to eq(p['Description'])
|
26
|
+
expect(r[:is_active]).to eq(p['IsActive'])
|
27
|
+
expect(r[:icon_css_class]).to eq(p['IconCssClass'])
|
28
|
+
expect(r[:content_channel_type_id]).to eq(p['ContentChannelTypeId'])
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe RockRMS::Response::ContentChannelType, type: :model do
|
4
|
+
let(:parsed) { JSON.parse(FixturesHelper.read('content_channel_types.json')) }
|
5
|
+
|
6
|
+
describe '.format' do
|
7
|
+
subject(:result) { described_class.format(parsed) }
|
8
|
+
|
9
|
+
context 'when response is array' do
|
10
|
+
it 'returns an array' do
|
11
|
+
expect(described_class.format([])).to be_a(Array)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'has the correct number keys' do
|
16
|
+
keys = result.first.keys
|
17
|
+
expect(keys.count).to eq(9)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'translates keys' do
|
21
|
+
result.zip(parsed) do |r, p|
|
22
|
+
expect(r[:id]).to eq(p['Id'])
|
23
|
+
expect(r[:name]).to eq(p['Name'])
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -17,7 +17,6 @@ RSpec.describe RockRMS::Response::RecurringDonation, type: :model do
|
|
17
17
|
expected_keys = %i[
|
18
18
|
active
|
19
19
|
financial_gateway_id
|
20
|
-
foreign_key
|
21
20
|
frequency
|
22
21
|
end_date
|
23
22
|
gateway_schedule_id
|
@@ -38,6 +37,7 @@ RSpec.describe RockRMS::Response::RecurringDonation, type: :model do
|
|
38
37
|
created_by_person_alias_id
|
39
38
|
attributes
|
40
39
|
attribute_values
|
40
|
+
foreign_key
|
41
41
|
]
|
42
42
|
|
43
43
|
expect(response.keys).to eq(expected_keys)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"Id": 345,
|
3
|
+
"ForeignKey": null,
|
4
|
+
"Name": "Channel name",
|
5
|
+
"Description": "Channel description",
|
6
|
+
"IsActive": true,
|
7
|
+
"IconCssClass": "icon-class",
|
8
|
+
"ChannelTypeId": "1",
|
9
|
+
"CreatedDateTime": null,
|
10
|
+
"ModifiedDateTime": "2017-07-26T14:41:58.103",
|
11
|
+
"CreatedByPersonAliasId": null,
|
12
|
+
"ModifiedByPersonAliasId": 12
|
13
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"Id": 345,
|
4
|
+
"ForeignKey": null,
|
5
|
+
"Name": "Channel name",
|
6
|
+
"Description": "Channel description",
|
7
|
+
"IsActive": true,
|
8
|
+
"IconCssClass": "icon-class",
|
9
|
+
"ChannelTypeId": "1",
|
10
|
+
"CreatedDateTime": null,
|
11
|
+
"ModifiedDateTime": "2017-07-26T14:41:58.103",
|
12
|
+
"CreatedByPersonAliasId": null,
|
13
|
+
"ModifiedByPersonAliasId": 12
|
14
|
+
}
|
15
|
+
]
|
data/spec/support/rock_mock.rb
CHANGED
@@ -26,6 +26,12 @@ class RockMock < Sinatra::Base
|
|
26
26
|
batch: 'FinancialBatches/:id',
|
27
27
|
batches: 'FinancialBatches',
|
28
28
|
campus: 'Campuses/:id',
|
29
|
+
content_channel: 'ContentChannels/:id',
|
30
|
+
content_channels: 'ContentChannels',
|
31
|
+
content_channel_item: 'ContentChannelItems/:id',
|
32
|
+
content_channel_items: 'ContentChannelItems',
|
33
|
+
content_channel_type: 'ContentChannelTypes/:id',
|
34
|
+
content_channel_types: 'ContentChannelTypes',
|
29
35
|
transaction: 'FinancialTransactions/:id',
|
30
36
|
transactions: 'FinancialTransactions',
|
31
37
|
defined_values:'DefinedValues',
|
@@ -88,6 +94,7 @@ class RockMock < Sinatra::Base
|
|
88
94
|
|
89
95
|
# PATCH requests
|
90
96
|
[
|
97
|
+
'ContentChannels/:id',
|
91
98
|
'FinancialBatches/:id',
|
92
99
|
'FinancialScheduledTransactions/:id',
|
93
100
|
'FinancialTransactions/:id',
|
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: 9.
|
4
|
+
version: 9.10.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: 2024-11-
|
11
|
+
date: 2024-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -194,6 +194,9 @@ files:
|
|
194
194
|
- lib/rock_rms/resources/block.rb
|
195
195
|
- lib/rock_rms/resources/block_type.rb
|
196
196
|
- lib/rock_rms/resources/campus.rb
|
197
|
+
- lib/rock_rms/resources/content_channel.rb
|
198
|
+
- lib/rock_rms/resources/content_channel_item.rb
|
199
|
+
- lib/rock_rms/resources/content_channel_type.rb
|
197
200
|
- lib/rock_rms/resources/defined_type.rb
|
198
201
|
- lib/rock_rms/resources/defined_value.rb
|
199
202
|
- lib/rock_rms/resources/exception_log.rb
|
@@ -231,6 +234,9 @@ files:
|
|
231
234
|
- lib/rock_rms/response/block.rb
|
232
235
|
- lib/rock_rms/response/block_type.rb
|
233
236
|
- lib/rock_rms/response/campus.rb
|
237
|
+
- lib/rock_rms/response/content_channel.rb
|
238
|
+
- lib/rock_rms/response/content_channel_item.rb
|
239
|
+
- lib/rock_rms/response/content_channel_type.rb
|
234
240
|
- lib/rock_rms/response/defined_type.rb
|
235
241
|
- lib/rock_rms/response/defined_value.rb
|
236
242
|
- lib/rock_rms/response/exception_log.rb
|
@@ -272,6 +278,9 @@ files:
|
|
272
278
|
- spec/rock_rms/resources/attribute_values_spec.rb
|
273
279
|
- spec/rock_rms/resources/batch_spec.rb
|
274
280
|
- spec/rock_rms/resources/campus_spec.rb
|
281
|
+
- spec/rock_rms/resources/content_channel_item_spec.rb
|
282
|
+
- spec/rock_rms/resources/content_channel_spec.rb
|
283
|
+
- spec/rock_rms/resources/content_channel_type_spec.rb
|
275
284
|
- spec/rock_rms/resources/gateway_spec.rb
|
276
285
|
- spec/rock_rms/resources/group_member_spec.rb
|
277
286
|
- spec/rock_rms/resources/group_spec.rb
|
@@ -292,6 +301,9 @@ files:
|
|
292
301
|
- spec/rock_rms/response/attribute_value_spec.rb
|
293
302
|
- spec/rock_rms/response/batch_spec.rb
|
294
303
|
- spec/rock_rms/response/campus_spec.rb
|
304
|
+
- spec/rock_rms/response/content_channel_item_spec.rb
|
305
|
+
- spec/rock_rms/response/content_channel_spec.rb
|
306
|
+
- spec/rock_rms/response/content_channel_type_spec.rb
|
295
307
|
- spec/rock_rms/response/defined_value_spec.rb
|
296
308
|
- spec/rock_rms/response/group_location_spec.rb
|
297
309
|
- spec/rock_rms/response/group_spec.rb
|
@@ -314,6 +326,12 @@ files:
|
|
314
326
|
- spec/support/fixtures/batches.json
|
315
327
|
- spec/support/fixtures/campus.json
|
316
328
|
- spec/support/fixtures/campuses.json
|
329
|
+
- spec/support/fixtures/content_channel.json
|
330
|
+
- spec/support/fixtures/content_channel_item.json
|
331
|
+
- spec/support/fixtures/content_channel_items.json
|
332
|
+
- spec/support/fixtures/content_channel_type.json
|
333
|
+
- spec/support/fixtures/content_channel_types.json
|
334
|
+
- spec/support/fixtures/content_channels.json
|
317
335
|
- spec/support/fixtures/create_attribute.json
|
318
336
|
- spec/support/fixtures/create_attribute_value.json
|
319
337
|
- spec/support/fixtures/create_batch.json
|