ruby on rails - Minitest doesn't respect setting config.active_record.pluralize_table_names to false -


i've been trying set first tests on rails 4.2.4 use singularized table names in dbs, add line config/application.rb

config.active_record.pluralize_table_names = false 

since i've being working on car , user models, let's assume i've generated each scaffold, , executed rake db:test:prepare problem begins tests follows:

in test/models/car_test.rb or user_test.rb, first uncomment stub test "the truth" , run vanilla following error rake test:models

# running:  ee  finished in 0.019095s, 104.7396 runs/s, 0.0000 assertions/s.    1) error: usertest#test_the_truth: activerecord::statementinvalid: sqlite3::sqlexception: no such table: users: delete "users"      2) error: cartest#test_necessary_car_data: activerecord::statementinvalid: sqlite3::sqlexception: no such table: users: delete "users"   2 runs, 0 assertions, 0 failures, 2 errors, 0 skips 

when run rake test:controllers same activerecord error shows multiple times , cannot fix behaviour in way far.

somebody else has come across issue? it's driving me mad...

ps: development without issues singular table names, mess lies in testing.

after tinkering lot discovered minitest uses each fixture filename translate name of table in db. so, when generated scaffold, created test/fixtures/users.yml

so changed filename user.yml , test started work again (i needed change fixture filenames).

at end, worked feels awkward change manually names when generator should doing that... knows go point out issue generator? registering github issue in official repo ok?


Comments