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

Fix undefined method issue in test #50638

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

dwightwatson
Copy link
Contributor

Motivation / Background

This Pull Request has been created because my test suite started failing at commit ref 27140247c21c3925ee971ca4437e9a7f6fe198a3, which comes from PR #50597.

Error:
UsersHelperTest#test_familiar_names_returns_ordered_familiar_names:
NoMethodError: undefined method `route_defined?' for nil
    test/helpers/users_helper_test.rb:7:in `block in <class:UsersHelperTest>'

Detail

I think the change in the above commit requires an additional safe navigation to route_defined? in order to preserve the same functionality from before the previous change and to fix the bug.

Additional information

Happy to provide a sample app demonstrating the bug if required.

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 behaviour change or additional feature. Minor bug fixes and documentation changes should not be included.

@rails-bot rails-bot bot added the actionpack label Jan 8, 2024
@Edouard-chin
Copy link
Member

You are right that it misses a safe navigation to behave as before. Can you please add a regression test in the Rails test suite ?

@Edouard-chin Edouard-chin added this to the 7.1.3 milestone Jan 8, 2024
@rafaelfranca rafaelfranca merged commit e940cab into rails:main Jan 8, 2024
4 checks passed
@skipkayhil skipkayhil modified the milestones: 7.1.3, 7.2.0 Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants