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 Parameters configuration integration tests #29677

Merged

Conversation

eugeneius
Copy link
Member

These tests ensure that ActionController::Parameters can be configured from an application initializer, which was recently fixed in 4c8332c.

r? @rafaelfranca


app "development"

ActionController::Base.object_id # force lazy load hooks to run
Copy link
Member Author

Choose a reason for hiding this comment

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

This is pretty ugly, but I couldn't come up with a better way to trigger the lazy load hooks.

Just referencing ActionController::Base without calling a method on it resulted in this warning:

railties/test/application/configuration_test.rb:1204: warning: possibly useless use of :: in void context

These tests relied on `ActionController::Parameters` being configured as
part of the boot process; since that now happens lazily we need to force
`ActionController::Base` to load so that we can test the behaviour.

The new tests added here ensure that `ActionController::Parameters` can
be configured from an initializer, which was broken until recently.
@eugeneius eugeneius force-pushed the parameters_configuration_tests branch from 3d903f3 to c1d01b7 Compare July 4, 2017 21:17
@eugeneius eugeneius changed the title Test coverage for Parameters configuration fix Fix Parameters configuration integration tests Jul 4, 2017
@eugeneius
Copy link
Member Author

4c8332c broke the Railties test suite, as the tests for the action_controller.parameters_config initializer assumed it would run during boot, and not lazily when Action Controller is loaded.

Those tests needed the same fix as the new tests being added here: forcing ActionController::Base to load so that the lazy load hooks run.

@eugeneius eugeneius force-pushed the parameters_configuration_tests branch from c1d01b7 to 458a550 Compare July 4, 2017 23:38
@rafaelfranca rafaelfranca merged commit 458a550 into rails:master Jul 5, 2017
rafaelfranca added a commit that referenced this pull request Jul 5, 2017
Fix Parameters configuration integration tests
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.

None yet

2 participants