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 7.1 / Rails 7.0 compatible changes #9336

Merged
merged 2 commits into from
Feb 5, 2025
Merged

Conversation

jrafanie
Copy link
Member

@jrafanie jrafanie commented Feb 5, 2025

Fix rails 7.1 removal, use to_fs(:dash) instead of Range#to_s(:dash)

Rails 7.0 was reporting this warning:

DEPRECATION WARNING: Range#to_s(:dash) is deprecated. Please use Range#to_fs(:dash) instead. (called from port_range_helper at /home/runner/work/manageiq-ui-classic/manageiq-ui-classic/app/helpers/security_group_helper/textual_summary.rb:105)

Assert redirect in a rails 7.1 friendly way

In rails 7.1, the response.body in the redirect is an empty string.

Rails 7.0 was reporting this warning:

DEPRECATION WARNING: Range#to_s(:dash) is deprecated. Please use Range#to_fs(:dash) instead. (called from port_range_helper at /home/runner/work/manageiq-ui-classic/manageiq-ui-classic/app/helpers/security_group_helper/textual_summary.rb:105)
In rails 7.1, the response.body in the redirect is an empty string.
@jrafanie jrafanie requested a review from a team as a code owner February 5, 2025 20:16
expect(response.body).to include("redirected")
expect(response.body).to include("ems_infra")
expect(response.status).to eq(302)
assert_redirected_to(%r(#{controller.ems_infra_path(@ems.id)}))
Copy link
Member Author

@jrafanie jrafanie Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use a regex here as I didn't think it was necessary to test the whole URL, such as:

http://test.host/ems_infra/1040?display=hosts&flash_msg=Nodes+were+added+successfully.+Refresh+queued.

@jrafanie
Copy link
Member Author

jrafanie commented Feb 5, 2025

@GilbertCherrie FYI, this fixes some issues on rails 7.1 in a 7.0 backward compatible way. Keep it in mind as we move to rails 7.1 soon.

@Fryguy Fryguy merged commit 5cb2633 into ManageIQ:master Feb 5, 2025
15 checks passed
@Fryguy Fryguy assigned Fryguy and unassigned GilbertCherrie Feb 5, 2025
@jrafanie jrafanie deleted the rails71 branch February 5, 2025 21:22
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.

3 participants