Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[patch] ActionController::TestCase#process barfs if it gets any frozen values as params

#6387

If you do this on Ruby 1.9 (or any encoding aware Ruby) it will get pissed:

TPS_REPORT_TOPICS = { 'synergy' => "Synergy", 'rev_stream' => "Revenue Streams" }

class ActionController::TestCase
  //...
  test "can create a TPS report with a topic" do
    get :create, :tps_report => { :topic => TPS_REPORT_TOPICS.keys.first }
  end
end

Since rails tries to force encoding in place on all strings that are passed in, it will raise an error if it gets a frozen string.

I included a patch that dups all strings that are passed as parameters so that rails doesn't do in-place encoding on the strings that are passed in as parameters

Reported by Trent Ogren · February 8th, 2011 @ 04:38 AM

State: new
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Derek Croft
    Derek Croft

    +1 - We need the ability to be able to use frozen strings in our tests.

    February 8th, 2011 @ 03:38 PM