Tag: RSpec/Rails4へ導入
group :development, :test do gem "rspec-rails", "~>2.14.0" gem "factory_girl_rails", "~>4.2.1" end group :test do gem "faker", "~>1.1.2" gem "capybara", "~>2.1.0" gem "database_cleaner", "~>1.0.1" gem "launchy", "~>2.3.0" gem "selenium-webdriver", "~>2.39.0" end
bundle install --path vendor/bundle
bundle exec rails generate rspec:install create .rspec create spec create spec/spec_helper.rb
config.generators do |g| g.test_framework :rspec, fixtures: true, view_specs: false, helper_specs: false, routing_specs: false, controller_specs: true, request_specs: false g.fixture_replacement :factory_girl, dir: "spec/factories" end
※注意事項)
group :development, :test do gem "rspec-rails" end
group :production, :development, :test do gem "rspec-rails" end
RAILS_ENV=development bundle exec rails g