Railsのテーブルにテストデータをinsertする。

/test/fixtures/table名.ymlを作成


# Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html

one:
  opening_price: 9.99
  low_price: 9.99
  high_price: 9.99
  closing_price: 9.99
  average_price: 9.99
  currency_type: 1
  created_on: 2011-09-21

two:
  opening_price: 9.99
  low_price: 9.99
  high_price: 9.99
  closing_price: 9.99
  average_price: 9.99
  currency_type: 1
  created_on: 2011-09-21

rake db:fixtures:load


CSVの場合
/test/fixtures/table名.csvを作成
csvの一行目はテーブルのカラム名を入れましょう

rake db:fixtures:load FIXTURES=exchanges