Skip to content

Instantly share code, notes, and snippets.

@arnab
Created June 11, 2012 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnab/2909535 to your computer and use it in GitHub Desktop.
Save arnab/2909535 to your computer and use it in GitHub Desktop.
Set up Rails 3.2 with Rspec and Cucumber
# Works with Rails 3.2.x (and this keeps changing due to the large amounts of gems and their author's philosophies differing all the time)
# 1. Create new Rails app
rails new <thing> --skip-testunit
# 2. Add the following to Gemfile:
group :development, :test do
gem 'rspec-rails'
gem 'cucumber-rails', :require => false
gem 'database_cleaner', :require => false
gem 'capybara'
end
# 3. install required gems via bundler
bundle install
# 4. Generate rspec stuff
rails g rspec:install
5. Make rspec the default for newly generated stuff
# in config/applicaton.rb
config.generators do |g|
g.test_framework :rspec
end
# 5. Generate cucumber stuff
rails g cucumber:install —rspec —capybara
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment