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.

There was a problem

You must be a member of this account.

This project is archived and is in readonly mode.

rails test doesn't load initializers when unit testing

#1177

I've got some custom inflection rules. One is for 'merk', it lives in 'initialializers/inflections.rb':

ActiveSupport::Inflector.inflections do |inflect| inflect.irregular 'merk', 'merken' end

But when I run rake test:units, I get an error:

test_truth(BrandstofTest): ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: merks: DELETE FROM "merks" WHERE 1=1

So, I think the custom inflection rules aren't loaded during these unit tests. However, if I go into 'script/console test', these rules work fine!

'merk'.pluralize => "merken"

Merk.delete_all => 0

Merk.table_name => "merken"

Reported by Leon Bogaert · October 5th, 2008 @ 11:26 PM

State: invalid
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Leon Bogaert
    Leon Bogaert

    Sorry, it was some bad fixture. This one can be closed.

    October 6th, 2008 @ 02:25 PM

  2. Frederick Cheung
    Frederick Cheung
    • State changed from new to invalid

    December 8th, 2008 @ 03:20 PM