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.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +4 -5
  3. data/README.md +0 -32
  4. data/Rakefile +4 -6
  5. data/govdelivery-tms.gemspec +15 -15
  6. data/lib/govdelivery-tms.rb +0 -9
  7. data/lib/govdelivery/tms/base.rb +4 -6
  8. data/lib/govdelivery/tms/client.rb +15 -16
  9. data/lib/govdelivery/tms/collection_resource.rb +7 -8
  10. data/lib/govdelivery/tms/connection.rb +4 -4
  11. data/lib/govdelivery/tms/errors.rb +7 -8
  12. data/lib/govdelivery/tms/instance_resource.rb +34 -39
  13. data/lib/govdelivery/tms/link_header.rb +27 -28
  14. data/lib/govdelivery/tms/mail/delivery_method.rb +11 -14
  15. data/lib/govdelivery/tms/resource/collections.rb +0 -20
  16. data/lib/govdelivery/tms/resource/command.rb +1 -2
  17. data/lib/govdelivery/tms/resource/command_action.rb +1 -1
  18. data/lib/govdelivery/tms/resource/command_type.rb +8 -9
  19. data/lib/govdelivery/tms/resource/email_message.rb +0 -1
  20. data/lib/govdelivery/tms/resource/email_recipient.rb +1 -1
  21. data/lib/govdelivery/tms/resource/from_address.rb +1 -1
  22. data/lib/govdelivery/tms/resource/inbound_sms_message.rb +1 -1
  23. data/lib/govdelivery/tms/resource/keyword.rb +6 -7
  24. data/lib/govdelivery/tms/resource/recipient.rb +1 -1
  25. data/lib/govdelivery/tms/resource/sms_message.rb +0 -1
  26. data/lib/govdelivery/tms/util/core_ext.rb +3 -3
  27. data/lib/govdelivery/tms/util/hal_link_parser.rb +11 -12
  28. data/lib/govdelivery/tms/version.rb +1 -1
  29. data/spec/client_spec.rb +6 -6
  30. data/spec/command_types_spec.rb +14 -14
  31. data/spec/email_message_spec.rb +42 -45
  32. data/spec/email_template_spec.rb +49 -51
  33. data/spec/errors_spec.rb +3 -3
  34. data/spec/from_address_spec.rb +37 -36
  35. data/spec/inbound_sms_messages_spec.rb +2 -2
  36. data/spec/instance_resource_spec.rb +4 -6
  37. data/spec/keyword_spec.rb +8 -10
  38. data/spec/keywords_spec.rb +4 -4
  39. data/spec/mail/delivery_method_spec.rb +8 -9
  40. data/spec/sms_message_spec.rb +9 -11
  41. data/spec/sms_messages_spec.rb +3 -3
  42. data/spec/spec_helper.rb +4 -5
  43. data/spec/tms_spec.rb +3 -3
  44. metadata +34 -64
  45. data/lib/govdelivery/tms/resource/ipaws_acknowledgement.rb +0 -9
  46. data/lib/govdelivery/tms/resource/ipaws_alert.rb +0 -38
  47. data/lib/govdelivery/tms/resource/ipaws_category.rb +0 -7
  48. data/lib/govdelivery/tms/resource/ipaws_cog_profile.rb +0 -29
  49. data/lib/govdelivery/tms/resource/ipaws_event_code.rb +0 -7
  50. data/lib/govdelivery/tms/resource/ipaws_nwem_area.rb +0 -18
  51. data/lib/govdelivery/tms/resource/ipaws_nwem_authorization.rb +0 -9
  52. data/lib/govdelivery/tms/resource/ipaws_nwem_auxilary_data.rb +0 -8
  53. data/lib/govdelivery/tms/resource/ipaws_response_type.rb +0 -7
  54. data/lib/govdelivery/tms/resource/ipaws_static_resource.rb +0 -8
  55. data/spec/ipaws_acknowledgement_spec.rb +0 -16
  56. data/spec/ipaws_alerts_spec.rb +0 -192
  57. data/spec/ipaws_cog_profile_spec.rb +0 -75
  58. data/spec/ipaws_event_codes_spec.rb +0 -35
  59. data/spec/ipaws_nwem_areas_spec.rb +0 -58
  60. 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