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

Rails 5 - Fix discussion_spec.rb #341

Merged
merged 4 commits into from
Jul 8, 2024
Merged

Conversation

yuenmichelle1
Copy link
Collaborator

Changes

  • update validation message spec. it is enough for us to test that discussion fails validation because there is no user. no need to check for a rails error message that has changed from 4 -> 5
  • after_commit callbacks do not run in transaction fixtures in specs for Rails 4, a workaround for Rails versions less than 5 is to use run_callbacks. Issue has been fixed in Rails 5. So we add a version check on spec. See https://stackoverflow.com/a/30901628/15768801 for more details.

yuenmichelle1 and others added 4 commits July 3, 2024 10:30
- update validation message spec. it is enough for us to test that discussion fails validation because there is no user. no need to check for a rails error message that has changed from 4 -> 5
- after_commit callbacks do not run in transaction fixtures in specs for Rails 4, a workaround for Rails versions less than 5 is to use run_callbacks. Issue has been fixed in Rails 5. So we add a version check on spec. See https://stackoverflow.com/a/30901628/15768801 for more details.
@yuenmichelle1 yuenmichelle1 marked this pull request as ready for review July 3, 2024 15:42
@yuenmichelle1 yuenmichelle1 merged commit 3c0bca3 into master Jul 8, 2024
1 of 2 checks passed
@yuenmichelle1 yuenmichelle1 deleted the rails-5-fix-discussion-spec branch July 18, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants