usps-imis-api 0.3.1.pre.8 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de5448a27ff10181a75b5deb4d6a25bf7ad8349360a1ddea7fa64cc79b64925c
4
- data.tar.gz: 59f78c0058d9f6dae4e39e58b4a2305229ad95eec9bff4c52ef77309034db1ea
3
+ metadata.gz: 6196e7258629848261198d3277f1d21fd9bff4a3fd021daf7f7412fbe04e7b06
4
+ data.tar.gz: 754a70f94ba0f03409c0021a4c416b581285c7574d12f5b9f686ff81491df540
5
5
  SHA512:
6
- metadata.gz: 0a98a3af09accbcb029f0ebe37c6b83aa008890b611efb0177359276c3e019e44552b127e08354153f103a9da62504435fdd828868e17e7d75e0eeafaf79b9e1
7
- data.tar.gz: 7e0ae652d4ee8dbc0c2adb6fee5a5383510769c2a14bddbb8d577eeda95fc7eef197e5259b5ad27b0bd932494ef37dff8e96abf7544b50b5fe1edec6088d681a
6
+ metadata.gz: 422554164e68b922847af8709c0f15cf24ba100cd19bab86dcab7cf125b54aefe157a8d128cfc2c7e08429a9ac549e326787e6a8a3941ab7ce37f4fd4c5fe28e
7
+ data.tar.gz: 156d0e14d1a1d1c0d7724924adfa67a41e4e8caf006860bed5222156c47e2ce5d73ba72758c98e84ceb67ece8c7ba6ab8997338c9f4e54efdc4a9b66d8e3dd06
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- usps-imis-api (0.3.1.pre.6)
4
+ usps-imis-api (0.3.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -56,49 +56,49 @@ module Usps
56
56
  end
57
57
  ),
58
58
  {
59
- "$type" => "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
60
- "Name" => "ABC_EDUC_THRU_DATE",
61
- "Value" => (data[:thru_date] || "0001-01-01T00:00:00")
59
+ '$type' => 'Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts',
60
+ 'Name' => 'ABC_EDUC_THRU_DATE',
61
+ 'Value' => data[:thru_date] || '0001-01-01T00:00:00'
62
62
  },
63
63
  {
64
- "$type" => "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
65
- "Name" => "ABC_ECertificate",
66
- "Value" => data[:certificate]
64
+ '$type' => 'Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts',
65
+ 'Name' => 'ABC_ECertificate',
66
+ 'Value' => data[:certificate]
67
67
  },
68
68
  {
69
- "$type" => "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
70
- "Name" => "ABC_Educ_Description",
71
- "Value" => data[:description]
69
+ '$type' => 'Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts',
70
+ 'Name' => 'ABC_Educ_Description',
71
+ 'Value' => data[:description]
72
72
  },
73
73
  {
74
- "$type" => "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
75
- "Name" => "ABC_Educ_Effective_Date",
76
- "Value" => data[:effective_date]
74
+ '$type' => 'Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts',
75
+ 'Name' => 'ABC_Educ_Effective_Date',
76
+ 'Value' => data[:effective_date]
77
77
  },
78
78
  {
79
- "$type" => "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
80
- "Name" => "ABC_Educ_Source_System",
81
- "Value" => data[:source]
79
+ '$type' => 'Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts',
80
+ 'Name' => 'ABC_Educ_Source_System',
81
+ 'Value' => data[:source]
82
82
  },
83
83
  {
84
- "$type" => "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
85
- "Name" => "ABC_Educ_Transaction_Date",
86
- "Value" => Time.zone.now.strftime('%Y-%m-%dT%H:%I:%S')
84
+ '$type' => 'Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts',
85
+ 'Name' => 'ABC_Educ_Transaction_Date',
86
+ 'Value' => Time.now.strftime('%Y-%m-%dT%H:%I:%S')
87
87
  },
88
88
  {
89
- "$type" => "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
90
- "Name" => "ABC_Other_Code",
91
- "Value" => date[:code]
89
+ '$type' => 'Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts',
90
+ 'Name' => 'ABC_Other_Code',
91
+ 'Value' => data[:code]
92
92
  },
93
93
  {
94
- "$type" => "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
95
- "Name" => "ABC_Product_Code",
96
- "Value" => date[:type_code]
94
+ '$type' => 'Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts',
95
+ 'Name' => 'ABC_Product_Code',
96
+ 'Value' => data[:type_code]
97
97
  },
98
98
  {
99
- "$type" => "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
100
- "Name" => "ABC_TYPE",
101
- "Value" => (data[:abc_type_code] || "EDUC")
99
+ '$type' => 'Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts',
100
+ 'Name' => 'ABC_TYPE',
101
+ 'Value' => data[:abc_type_code] || 'EDUC'
102
102
  }
103
103
  ].compact
104
104
  }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Usps
4
4
  module Imis
5
- VERSION = '0.3.1-8'
5
+ VERSION = '0.3.2'
6
6
  end
7
7
  end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Usps::Imis::Panel::Education do
6
+ let(:education) { described_class.new }
7
+
8
+ let(:details) do
9
+ {
10
+ certificate: 'E136924',
11
+ description: 'Marine Navigation',
12
+ effective_date: Time.now.strftime('%Y-%m-%dT00:00:00'),
13
+ source: 'Online Exams System',
14
+ code: 'MN',
15
+ type_code: 'CRS'
16
+
17
+ }
18
+ end
19
+
20
+ before { education.api.imis_id = 6374 }
21
+
22
+ describe '#get' do
23
+ it 'loads a specific object' do
24
+ expect(education.get(90737)).to be_a(Hash)
25
+ end
26
+ end
27
+
28
+ # rubocop:disable RSpec/ExampleLength
29
+ it 'handles new records correctly', :aggregate_failures do
30
+ new_record = education.create(details)
31
+ expect(new_record).to be_a(Hash)
32
+
33
+ ordinal = new_record['Properties']['$values'][1]['Value']['$value']
34
+
35
+ update_result =
36
+ education.update(details.merge(source: 'Online Exams System - Modified', ordinal: ordinal))
37
+ updated = update_result['Properties']['$values'].find do |v|
38
+ v['Name'] == 'ABC_Educ_Source_System'
39
+ end
40
+ expect(updated['Value']).to eq('Online Exams System - Modified')
41
+
42
+ expect(education.destroy(ordinal)).to eq('')
43
+ end
44
+ # rubocop:enable RSpec/ExampleLength
45
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usps-imis-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1.pre.8
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander
@@ -39,6 +39,7 @@ files:
39
39
  - lib/usps/imis/version.rb
40
40
  - spec/lib/usps/imis/api_spec.rb
41
41
  - spec/lib/usps/imis/mapper_spec.rb
42
+ - spec/lib/usps/imis/panel/education_spec.rb
42
43
  - spec/lib/usps/imis/panel/vsc_spec.rb
43
44
  - spec/spec_helper.rb
44
45
  - usps-imis-api.gemspec