usps-imis-api 0.3.1.pre.8 → 0.3.1
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/usps/imis/panel/education.rb +3 -3
- data/lib/usps/imis/version.rb +1 -1
- data/spec/lib/usps/imis/panel/education_spec.rb +42 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 363b03cdc0a93fdde0cf8409874723a07501191f271a23994a2a657ef82ccb2f
|
4
|
+
data.tar.gz: 1daa873de5c75094cc755cd9dec593b899388edf337036cb9e53949c4f15c191
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f795e80baefffaa7a7dad8f18945c1b388b311419ab5bff7bc4de138647b9cdbe2c893ae82675248c36b8c76662394a2feb51312d0321e0b26ebd0d145b7d28d
|
7
|
+
data.tar.gz: 742ec65ee15fb91082173f398b9fac89859f78ec32b041ca7332ab5e0fa5a44dd325d91af4e8cecfc04f64f3dc6617de22d078583e9c53e61dc527ebeb1969b9
|
data/Gemfile.lock
CHANGED
@@ -83,17 +83,17 @@ module Usps
|
|
83
83
|
{
|
84
84
|
"$type" => "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
|
85
85
|
"Name" => "ABC_Educ_Transaction_Date",
|
86
|
-
"Value" => Time.
|
86
|
+
"Value" => Time.now.strftime('%Y-%m-%dT%H:%I:%S')
|
87
87
|
},
|
88
88
|
{
|
89
89
|
"$type" => "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
|
90
90
|
"Name" => "ABC_Other_Code",
|
91
|
-
"Value" =>
|
91
|
+
"Value" => data[:code]
|
92
92
|
},
|
93
93
|
{
|
94
94
|
"$type" => "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
|
95
95
|
"Name" => "ABC_Product_Code",
|
96
|
-
"Value" =>
|
96
|
+
"Value" => data[:type_code]
|
97
97
|
},
|
98
98
|
{
|
99
99
|
"$type" => "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
|
data/lib/usps/imis/version.rb
CHANGED
@@ -0,0 +1,42 @@
|
|
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 = education.update(details.merge(source: 'Online Exams System - Modified', ordinal: ordinal))
|
36
|
+
updated = update_result['Properties']['$values'].find { |v| v['Name'] == 'ABC_Educ_Source_System' }
|
37
|
+
expect(updated['Value']).to eq('Online Exams System - Modified')
|
38
|
+
|
39
|
+
expect(education.destroy(ordinal)).to eq('')
|
40
|
+
end
|
41
|
+
# rubocop:enable RSpec/ExampleLength
|
42
|
+
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
|
4
|
+
version: 0.3.1
|
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
|