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

Support rendering partials from controller renderers #96

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/renderer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ class RendererTest < NicePartials::Test
assert_css "p", text: "UPCASED"
end

test "TestController.render partial that declares helper methods" do
TestController.renderer.render partial: "partial_with_helpers" do
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@kaspth currently, this PR is aspirational. This test fails with the stack trace provided in the PR description. I haven't had much success troubleshooting, but I have the sense that it's related to how the monkey patch is (or isn't) being applied to the ActionView::Base instance available to renderer.render calls.

"upcased"
end

assert_css "p", text: "UPCASED"
end

test "render partial exposes helper methods to callers" do
render "partial_with_helpers" do |partial|
partial.squish "text with spaces"
Expand Down