Project

General

Profile

Actions

Defect #30811

closed

"rake db:fixtures:load" does not work

Added by Go MAEDA almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Rails provides a rake task db:fixtures:load to load fixtures to the database. Fixture data is useful to prepare Redmine for testing. But, in Redmine, the task fails due to test/fixtures/configuration/*.yml.

$ bin/rake db:fixtures:load
rake aborted!
ActiveRecord::Fixture::FormatError: fixture key is not a hash: /Users/maeda/redmines/redmine-trunk/test/fixtures/configuration/default.yml, keys: ["production", "development", "test"]

This is because db:fixtures:load assumes that all files which have .yml extension are fixtures. Actually test/fixtures/configuration/*.yml are not fixtures but files used to test lib/redmine/configuration.rb.

To run db:fixtures:load without errors, I suggest changing the extension of those files from .yml to another extension such as .yml.txt.


Files

30811.patch (1.33 KB) 30811.patch Takenori TAKAKI, 2019-02-18 17:08
rename_configration_fixtures.patch (2.18 KB) rename_configration_fixtures.patch Takenori TAKAKI, 2019-02-19 06:16

Related issues

Related to Redmine - Patch #35466: Rename test/fixtures/configuration/*.yml.example to test/fixtures/files/configuration/*.ymlClosedGo MAEDA

Actions
Actions

Also available in: Atom PDF