2016-07-13から1日間の記事一覧
db/seeds.rbの中でFactoryGirlを使う方法をメモ 前提 RSpecとFactoryGirlがインストール済みであること。 blog.naichilab.com blog.naichilab.com ファクトリーの定義 FactoryGirlをインストール後にModelをGenerateしてれば勝手に作られてるはず。 なければ…
Ruby on Railsのインストール方法や使い方、つまづいた点などをまとめています。
毎回忘れるのでメモ 準備 RSpecを入れておく blog.naichilab.com Gem group :development, :test do gem 'factory_girl_rails' end $ bundle install spec/rails_helper.rb RSpec.configure do |config| 〜〜 # 下記1行追加 config.include FactoryGirl::Sy…
毎回忘れるので自分用にメモ Gem group :development, :test do gem 'rspec-rails' end $ bundle install インストール $ bundle exec rails g rspec:install Running via Spring preloader in process 25125 create .rspec create spec create spec/spec_he…