govdelivery-tms 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +4 -5
- data/README.md +0 -32
- data/Rakefile +4 -6
- data/govdelivery-tms.gemspec +15 -15
- data/lib/govdelivery-tms.rb +0 -9
- data/lib/govdelivery/tms/base.rb +4 -6
- data/lib/govdelivery/tms/client.rb +15 -16
- data/lib/govdelivery/tms/collection_resource.rb +7 -8
- data/lib/govdelivery/tms/connection.rb +4 -4
- data/lib/govdelivery/tms/errors.rb +7 -8
- data/lib/govdelivery/tms/instance_resource.rb +34 -39
- data/lib/govdelivery/tms/link_header.rb +27 -28
- data/lib/govdelivery/tms/mail/delivery_method.rb +11 -14
- data/lib/govdelivery/tms/resource/collections.rb +0 -20
- data/lib/govdelivery/tms/resource/command.rb +1 -2
- data/lib/govdelivery/tms/resource/command_action.rb +1 -1
- data/lib/govdelivery/tms/resource/command_type.rb +8 -9
- data/lib/govdelivery/tms/resource/email_message.rb +0 -1
- data/lib/govdelivery/tms/resource/email_recipient.rb +1 -1
- data/lib/govdelivery/tms/resource/from_address.rb +1 -1
- data/lib/govdelivery/tms/resource/inbound_sms_message.rb +1 -1
- data/lib/govdelivery/tms/resource/keyword.rb +6 -7
- data/lib/govdelivery/tms/resource/recipient.rb +1 -1
- data/lib/govdelivery/tms/resource/sms_message.rb +0 -1
- data/lib/govdelivery/tms/util/core_ext.rb +3 -3
- data/lib/govdelivery/tms/util/hal_link_parser.rb +11 -12
- data/lib/govdelivery/tms/version.rb +1 -1
- data/spec/client_spec.rb +6 -6
- data/spec/command_types_spec.rb +14 -14
- data/spec/email_message_spec.rb +42 -45
- data/spec/email_template_spec.rb +49 -51
- data/spec/errors_spec.rb +3 -3
- data/spec/from_address_spec.rb +37 -36
- data/spec/inbound_sms_messages_spec.rb +2 -2
- data/spec/instance_resource_spec.rb +4 -6
- data/spec/keyword_spec.rb +8 -10
- data/spec/keywords_spec.rb +4 -4
- data/spec/mail/delivery_method_spec.rb +8 -9
- data/spec/sms_message_spec.rb +9 -11
- data/spec/sms_messages_spec.rb +3 -3
- data/spec/spec_helper.rb +4 -5
- data/spec/tms_spec.rb +3 -3
- metadata +34 -64
- data/lib/govdelivery/tms/resource/ipaws_acknowledgement.rb +0 -9
- data/lib/govdelivery/tms/resource/ipaws_alert.rb +0 -38
- data/lib/govdelivery/tms/resource/ipaws_category.rb +0 -7
- data/lib/govdelivery/tms/resource/ipaws_cog_profile.rb +0 -29
- data/lib/govdelivery/tms/resource/ipaws_event_code.rb +0 -7
- data/lib/govdelivery/tms/resource/ipaws_nwem_area.rb +0 -18
- data/lib/govdelivery/tms/resource/ipaws_nwem_authorization.rb +0 -9
- data/lib/govdelivery/tms/resource/ipaws_nwem_auxilary_data.rb +0 -8
- data/lib/govdelivery/tms/resource/ipaws_response_type.rb +0 -7
- data/lib/govdelivery/tms/resource/ipaws_static_resource.rb +0 -8
- data/spec/ipaws_acknowledgement_spec.rb +0 -16
- data/spec/ipaws_alerts_spec.rb +0 -192
- data/spec/ipaws_cog_profile_spec.rb +0 -75
- data/spec/ipaws_event_codes_spec.rb +0 -35
- data/spec/ipaws_nwem_areas_spec.rb +0 -58
- data/spec/ipaws_nwem_authorization_spec.rb +0 -16
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe GovDelivery::TMS::IpawsEventCodes do
|
4
|
-
context "loading Ipaws event codes" do
|
5
|
-
let(:client) { double('client') }
|
6
|
-
let(:event_codes) { GovDelivery::TMS::IpawsEventCodes.new(client, '/ipaws/event_codes') }
|
7
|
-
it 'should GET itself' do
|
8
|
-
body = [
|
9
|
-
{
|
10
|
-
value: 'ADR',
|
11
|
-
description: 'Administrative Message/Follow up Statement',
|
12
|
-
cap_exchange: true,
|
13
|
-
core_ipaws_profile: true,
|
14
|
-
nwem: true,
|
15
|
-
eas_and_public: true,
|
16
|
-
cmas: true
|
17
|
-
},
|
18
|
-
{
|
19
|
-
value: 'AVA',
|
20
|
-
description: 'Avalanche Watch',
|
21
|
-
cap_exchange: true,
|
22
|
-
core_ipaws_profile: true,
|
23
|
-
nwem: true,
|
24
|
-
eas_and_public: true,
|
25
|
-
cmas: false }
|
26
|
-
]
|
27
|
-
expect(client).to receive(:get).and_return(double('response', body: body, status: 200, headers: {}))
|
28
|
-
event_codes.get
|
29
|
-
expect(event_codes.collection.length).to eq(2)
|
30
|
-
event_codes.collection.each do |event_code|
|
31
|
-
expect(event_code).to be_an_instance_of(GovDelivery::TMS::IpawsEventCode)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe GovDelivery::TMS::IpawsNwemAreas do
|
4
|
-
|
5
|
-
it 'gets IPAWS NWEM areas from client' do
|
6
|
-
client = double(:client)
|
7
|
-
response_body = [
|
8
|
-
{
|
9
|
-
"countyFipsCd"=>"51013",
|
10
|
-
"countyName"=>"Arlington",
|
11
|
-
"geoType"=>"C",
|
12
|
-
"stateCd"=>"VA",
|
13
|
-
"stateFips"=>"51",
|
14
|
-
"stateName"=>"Virginia",
|
15
|
-
"zoneCd"=>"054",
|
16
|
-
"zoneName"=>"Arlington/Falls Church/Alexandria"
|
17
|
-
},
|
18
|
-
{
|
19
|
-
"countyFipsCd"=>"51510",
|
20
|
-
"countyName"=>"City of Alexandria",
|
21
|
-
"geoType"=>"C",
|
22
|
-
"stateCd"=>"VA",
|
23
|
-
"stateFips"=>"51",
|
24
|
-
"stateName"=>"Virginia",
|
25
|
-
"zoneCd"=>"054",
|
26
|
-
"zoneName"=>"Arlington/Falls Church/Alexandria"
|
27
|
-
}
|
28
|
-
]
|
29
|
-
nwem_areas = GovDelivery::TMS::IpawsNwemAreas.new(client, '/ipaws/nwem_areas')
|
30
|
-
|
31
|
-
expect(nwem_areas.client).to receive('get').with(nwem_areas.href).and_return(
|
32
|
-
double('response', status: 200, body: response_body, headers: {})
|
33
|
-
)
|
34
|
-
expect(nwem_areas.get).to eq(nwem_areas)
|
35
|
-
expect(nwem_areas.collection.size).to eq(2)
|
36
|
-
|
37
|
-
nwem_area = nwem_areas.collection[0]
|
38
|
-
expect(nwem_area.countyFipsCd).to eq('51013')
|
39
|
-
expect(nwem_area.countyName).to eq('Arlington')
|
40
|
-
expect(nwem_area.geoType).to eq('C')
|
41
|
-
expect(nwem_area.stateCd).to eq('VA')
|
42
|
-
expect(nwem_area.stateFips).to eq('51')
|
43
|
-
expect(nwem_area.stateName).to eq('Virginia')
|
44
|
-
expect(nwem_area.zoneCd).to eq('054')
|
45
|
-
expect(nwem_area.zoneName).to eq('Arlington/Falls Church/Alexandria')
|
46
|
-
|
47
|
-
nwem_area = nwem_areas.collection[1]
|
48
|
-
expect(nwem_area.countyFipsCd).to eq('51510')
|
49
|
-
expect(nwem_area.countyName).to eq('City of Alexandria')
|
50
|
-
expect(nwem_area.geoType).to eq('C')
|
51
|
-
expect(nwem_area.stateCd).to eq('VA')
|
52
|
-
expect(nwem_area.stateFips).to eq('51')
|
53
|
-
expect(nwem_area.stateName).to eq('Virginia')
|
54
|
-
expect(nwem_area.zoneCd).to eq('054')
|
55
|
-
expect(nwem_area.zoneName).to eq('Arlington/Falls Church/Alexandria')
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe GovDelivery::TMS::IpawsNwemAuthorization do
|
4
|
-
|
5
|
-
it 'gets IPAWS NWEM Authorization from client' do
|
6
|
-
client = double(:client)
|
7
|
-
response_body = { "cogid" => "true" }
|
8
|
-
nwem_authorization = GovDelivery::TMS::IpawsNwemAuthorization.new(client, '/ipaws/nwem_authorization', {})
|
9
|
-
expect(nwem_authorization.client).to receive('get').with(nwem_authorization.href).and_return(
|
10
|
-
double('response', status: 200, body: response_body)
|
11
|
-
)
|
12
|
-
expect(nwem_authorization.get).to eq(nwem_authorization)
|
13
|
-
expect(nwem_authorization.cogid).to eq("true")
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|