Utf8 encoding makes functional testing troubled

Hi,

I installed localization_simplified plugin. The README said like this:
This plugin modifies the following most used helpers for Rails

  • Sets UTF-8 content-type HTTP header
  • Sets UTF-8 connection to database
  • Localized monthnames on date_select etc. (changing the order of Y-M-D,
    on date_select and datetime_select from 0.7)
  • Localized ActiveRecord errors (and error headings)
  • Localized distance_of_time_in_words
  • Localized to_currency (from 0.7 also changing the order of
    unit/currency)
  • Simple pluralization also available in the lang-file
  • Uses standard Rails methods. In this way, there is no tedious rewrite
    required

localization_simplified plugin is in RAILS/vendor/plugins directory.

When I try to run the simple functional test which is like this:
class ThermoDetectorControllerTest < Test::Unit::TestCase
def setup
@controller = ThermoDetectorController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end

Replace this with your real tests.

def test_new
get :list
assert_response :success
end
end

it fails, saying:
test_new(ThermoDetectorControllerTest):
ActiveRecord::StatementInvalid: PGError: ERROR: current transaction is
aborted, commands ignored until end of transaction block
: SELECT * FROM thermo_detector_order_letters
blablabla

When I move the localization_simplified plugin into another directory,
run the test, it works…

So any idea? Assumed this is unfixable, how do I dinamycly unload the
localization_simplified directory when running the functional testing?

Thank you.

On 10/28/06, Akbar H. [email protected] wrote:

aborted, commands ignored until end of transaction block
: SELECT * FROM thermo_detector_order_letters
blablabla

When I move the localization_simplified plugin into another directory,
run the test, it works…

So any idea? Assumed this is unfixable, how do I dinamycly unload the
localization_simplified directory when running the functional testing?

My gut feeling is that it shouldn’t be unfixable. And then the correct
course of action would be to fix your tests. There are a lot of Ruby
functions that cannot be used safely with Unicode. Change your
tests to be Unicode friendly.