Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hinzed1127 committed Apr 24, 2024
1 parent 87a9563 commit bd7e5db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/travel_pay/app/services/travel_pay/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_claims(veis_token, btsss_token)

symbolized_body = response.body.deep_symbolize_keys
parse_claim_date = ->(c) { Date.parse(c[:modifiedOn]) }
symbolized_body[:data].sort_by(&parse_claim_date).reverse!
symbolized_body[:data].sort_by!(&parse_claim_date).reverse!
symbolized_body
end

Expand Down
8 changes: 4 additions & 4 deletions modules/travel_pay/spec/services/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@
'data' => [
{
'id' => 'uuid1',
'modified_on' => '2024-01-01'
'modifiedOn' => '2024-01-01'
},
{
'id' => 'uuid2',
'modified_on' => '2024-03-01'
'modifiedOn' => '2024-03-01'
},
{
'id' => 'uuid3',
'modified_on' => '2024-02-01'
'modifiedOn' => '2024-02-01'
}
]
}
Expand All @@ -101,7 +101,7 @@

client = TravelPay::Client.new
claims = client.get_claims('veis_token', 'btsss_token')
actual_claim_ids = claims.pluck(:id)
actual_claim_ids = claims[:data].pluck(:id)

expect(actual_claim_ids).to eq(expected_ordered_ids)
end
Expand Down

0 comments on commit bd7e5db

Please sign in to comment.