-
Notifications
You must be signed in to change notification settings - Fork 54
Allow assert_template(file:) to work using Rails 6 #46
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||
| module Rails | ||||||
| module Controller | ||||||
| module Testing | ||||||
| module InstrumentDetermineTemplate | ||||||
| def determine_template(options) | ||||||
| super.tap do |found| | ||||||
| if found | ||||||
| instrument_payload = { template_identifier: found.identifier, virtual_path: found.virtual_path, options: options } | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
@cpruitt I reported this error here: #46 (comment)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bbugh Thanks for the suggested change. Our test implementation changed such that I'm not in a great position to reproduce this problem or test this fix. I believe the original issue that this PR was intended to resolve changed and this PR just happened to still fix a similar problem. I'm not currently able to allocate time to get up to speed to verify that and test this out. If you have available time, I'd wholeheartedly endorse you taking this and running with it in a new PR. I'm happy to help answer any questions I can (thought I don't know how much help that would be). 🙂 |
||||||
| ActiveSupport::Notifications.instrument("determine_template.rails_controller_testing", instrument_payload) | ||||||
| end | ||||||
| end | ||||||
| end | ||||||
| end | ||||||
| end | ||||||
| end | ||||||
| end | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should include this inside an
on_load(:action_view)otherwise we could prepend this same module three times to the same class when running tests.