From 3b9e3ceff5a7a3a55aec400f1956f56fdbdd5efc Mon Sep 17 00:00:00 2001 From: Sergey Novikov Date: Mon, 18 Sep 2017 22:12:51 +0200 Subject: Allow usage of strings as locals for partial renderer --- actionview/test/actionpack/controller/render_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'actionview/test/actionpack/controller') diff --git a/actionview/test/actionpack/controller/render_test.rb b/actionview/test/actionpack/controller/render_test.rb index 9df2a73448..6e61b12285 100644 --- a/actionview/test/actionpack/controller/render_test.rb +++ b/actionview/test/actionpack/controller/render_test.rb @@ -489,6 +489,10 @@ class TestController < ApplicationController render partial: "customer", locals: { customer: Customer.new("david") } end + def partial_with_string_locals + render partial: "customer", locals: { "customer" => Customer.new("david") } + end + def partial_with_form_builder render partial: ActionView::Helpers::FormBuilder.new(:post, nil, view_context, {}) end @@ -1169,6 +1173,11 @@ class RenderTest < ActionController::TestCase assert_equal "Hello: david", @response.body end + def test_partial_with_string_locals + get :partial_with_string_locals + assert_equal "Hello: david", @response.body + end + def test_partial_with_form_builder get :partial_with_form_builder assert_equal "\n", @response.body -- cgit v1.2.3