RCBC-461: Call extract_expiry_time
in to_backend
of options instead of constructor
#124
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Utils::Time.extract_expiry_time(expiry)
transforms the expiry to the format expected by the backend. Currently it is called in the constructor, which means that if expiry is set through the setter, it is not being called and the expiry is sent to the backend in the incorrect format resulting in anArgumentError
.Modification
Call
extract_expiry_time
in the#to_backend
method instead, so it is always called irrespective of whether expiry was set through the setter or the constructorResults
This was causing tests in FIT's
ExpiryTest
to fail (the performer was using the setter). Now these tests pass.