Skip to content

Commit

Permalink
Add serlization for tracking_list, tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dcloud committed Mar 22, 2024
1 parent a36a079 commit 32848ec
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ def rx_rf_records
records = object&.rx_rf_records
records&.dig(0, 1) || []
end

def tracking_list
tracking_list = object&.tracking_list
tracking_list&.dig(0, 1) || []
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,11 @@
expect(attributes['rx_rf_records']).to be_an(Array)
expect(attributes['rx_rf_records']).to all(be_a(Hash))
end

it 'includes the tracking_list records as an array' do
tracking_list = attributes['tracking_list']
expect(tracking_list).to be_an(Array)
expect(tracking_list[0]).to all(be_a(Hash))
expect(tracking_list[0]).to include(carrier: 'UPS', complete_date_time: '2023-03-28T04:39:11-04:00')
end
end
39 changes: 39 additions & 0 deletions spec/factories/prescription_details.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,44 @@
]
]
}
tracking_list {
[
[
'tracking',
[
{
carrier: 'UPS',
completeDateTime: '2023-03-28T04:39:11-04:00',
dateLoaded: '2023-06-21T13:05:19-04:00',
dialDivisionPhone: '3082719803',
divisionPhone: '(308)271-9803',
id: 3974,
isLocalTracking: false,
ndc: '00113002239',
othersInSamePackage: false,
rxNumber: 2_719_799,
stationNumber: 994,
trackingNumber: '772980271979930000002254',
viewImageDisplayed: true
},
{
carrier: 'FedEx',
completeDateTime: '2023-05-28T04:39:11-04:00',
dateLoaded: '2023-04-21T16:55:19-04:00',
dialDivisionPhone: '4012719804',
divisionPhone: '(401)271-9804',
id: 9878,
isLocalTracking: false,
ndc: '00113002240',
othersInSamePackage: false,
rxNumber: 2_719_780,
stationNumber: 995,
trackingNumber: '332980271979930000002300',
viewImageDisplayed: false
}
]
]
]
}
end
end

0 comments on commit 32848ec

Please sign in to comment.