From 185c3dbc6ab845edfc94e8d38ef5be11c417dd81 Mon Sep 17 00:00:00 2001 From: Will Bryant Date: Sat, 15 Oct 2011 22:38:28 +1300 Subject: assigns(:foo) should not convert @foo's keys to strings if it happens to be a hash --- actionpack/lib/action_dispatch/testing/test_process.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/testing/test_process.rb b/actionpack/lib/action_dispatch/testing/test_process.rb index b08ff41950..3a6d081721 100644 --- a/actionpack/lib/action_dispatch/testing/test_process.rb +++ b/actionpack/lib/action_dispatch/testing/test_process.rb @@ -5,7 +5,8 @@ require 'active_support/core_ext/hash/indifferent_access' module ActionDispatch module TestProcess def assigns(key = nil) - assigns = @controller.view_assigns.with_indifferent_access + assigns = {}.with_indifferent_access + @controller.view_assigns.each {|k, v| assigns.regular_writer(k, v)} key.nil? ? assigns : assigns[key] end -- cgit v1.2.3