Skip to content

Lazy load ActionController and Routing matchers for ActionController::TestCase#1613

Merged
matsales28 merged 1 commit intothoughtbot:mainfrom
ilianah:lazy-load-action-controller-test-case
Mar 15, 2024
Merged

Lazy load ActionController and Routing matchers for ActionController::TestCase#1613
matsales28 merged 1 commit intothoughtbot:mainfrom
ilianah:lazy-load-action-controller-test-case

Conversation

@ilianah
Copy link
Copy Markdown
Contributor

@ilianah ilianah commented Feb 16, 2024

This PR sets up two on_load hooks to include the ActionController and Routing matchers modules into ActionController::TestCase. They run only when ActionController::TestCase is loaded rather than immediately whenever the integrate_with method is called.

This change should improve app booting performance by delaying the inclusion of the matchers until they are actually needed.

@ilianah ilianah force-pushed the lazy-load-action-controller-test-case branch from 0218d01 to 7c2bae6 Compare February 23, 2024 14:25
Copy link
Copy Markdown
Member

@matsales28 matsales28 left a comment

Choose a reason for hiding this comment

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

LGTM!

@matsales28 matsales28 merged commit 2793b9b into thoughtbot:main Mar 15, 2024
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.

3 participants