1. git clone https://github.com/saasbook/bdd-tdd-cycle
2.follow the instructions below to get setup:
1) Change into the rottenpotatoes directory: cd bdd-tdd-cycle/rottenpotatoes
2) Run bundle install --without production to make sure all gems are properly installed.
3) Run bundle exec rake db:migrate to apply database migrations.
4) Finally, run these commands to set up the Cucumber directories (under features/) and RSpec directories (under spec/) if they don't already exist, allowing overwrite of any existing files:
rails generate cucumber:install capybara
rails generate cucumber_rails_training_wheels:install
rails generate rspec:install
Notes1. some errors got while run bundle install
1) ruby version disagree, I change the Gemfile to agree with my ruby version
2)json-1.8.3 Gem::Ext::BuildError: ERROR: Failed to build gem native extension
the solution is to install libgmp3-dev.
sudo apt-get install libgmp3-dev
3) cannot load such file -- test/unit/
add the test-unit gem to your gemfile:gem 'test-unit'
4) cannot install debugger
change 'debugger' in Gemfile to 'byebug'.
5) warning: circular argument reference
delete the version specified in Gemfile, delete Gemfile.lock before rerun bundle install
6)LoadError: cannot load such file -- active_resource/railtie
If you do not need ActiveResource , then you will need to comment out/remove following line from application.rb:
1 | require "active_resource/railtie" |
Previously ActiveResource, was included by the rails gem as a dependency; now you'll have to add it explicitly if you want to use it.
gem 'activeresource'
7) NoMethodError: undefined method `whitelist_attributes=' for ActiveRecord::Base:Class
gem 'protected_attributes'
8) config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly
add config.eager_load = false to config/environment/test.rb
add config.eager_load = false to config/environment/development.rb
add config.eager_load = true to config/environment/production.rb
9)Migrations are pending. To resolve this issue, run:
rake db:migrate RAILS_ENV=test
10)DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the asset pipeline). The `serve_static_assets` alias will be removed in Rails 5.0. Please migrate your configuration files accordingly.
change config.serve_static_assets to `config.serve_static_files' in config/environment/test.rb
rm -f db/*.sqlite3
rake db:create
RAILS_ENV=test rake db:migrate