Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure system test scaffold supports datetime and time attributes #49409

Merged

Conversation

stevepolitodesign
Copy link
Contributor

Motivation / Background

Prior to this commit, system tests generated by a scaffold containing time or datetime attributes would fail during the update test. The captured screenshot would reveal the following client-side validation errors.

Please enter a valid value. The two nearest valid values are 10:45:33 AM
and 10:46:33 AM.

failures_test_should_update_time

Please enter a valid value. The two nearest valid values are 09/27/2023,
10:45:33 AM and 09/27/2023, 10:46:33 AM.

failures_test_should_update_datetime

Detail

This Pull Request updates the system test scaffold by conditionally converting time and datetime values to a string to ensures they are entered correctly and that the tests pass.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@rails-bot rails-bot bot added the railties label Sep 27, 2023
Prior to this commit, system tests generated by a scaffold containing
`time` or `datetime` attributes would fail during the update test. The
captured screenshot would reveal the following client-side validation
errors.

```
Please enter a valid value. The two nearest valid values are 10:45:33 AM
and 10:46:33 AM.
```

```
Please enter a valid value. The two nearest valid values are 09/27/2023,
10:45:33 AM and 09/27/2023, 10:46:33 AM.
```

Converting the values to a string ensures they are entered correctly and
that the tests pass.
@eileencodes eileencodes merged commit 9cb6f44 into rails:main Sep 28, 2023
4 checks passed
@eileencodes
Copy link
Member

Thanks!

@stevepolitodesign stevepolitodesign deleted the sp-datetime-local-scaffold branch September 28, 2023 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants