Skip to content

Instantly share code, notes, and snippets.

@zumbalogy
Created January 9, 2014 17:15
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 zumbalogy/8338016 to your computer and use it in GitHub Desktop.
Save zumbalogy/8338016 to your computer and use it in GitHub Desktop.
STARTING UP WITH RAILS Tunr App
$ rails new tunr_app -d postgresql -T
* update database.yml —> change default username to my username
* remove default index page —> $ rm public/index.html
$ rake db:create
* Create the database
$ rake db:migrate
* create the schema migration table so that we can use rake spec.
* when we run rake spec for the first time it will do this for us (if we want to just wait/skip this step)
# update gem file #
* gem 'rspec-rails'
* gem ‘capybara'
$ bundle install
* update the bundle with our testing suite
$ rails g rspec:install
* generate our base testing files in the project
# update spec helper #
* require ‘capybara/rspec’ (near the top)
* config.formatter = :documentation (somewhere within the RSpec.configure do |config| block)
* this shows us the nice documentation when we run our tests
$ rails g model Musician name:string
* create migration, model and spec
$ rake db:migrate
* to create that new table we wanted
## THIS IS WHERE WE REALLY START WORKING WITH TDD ##
FEATURES
$ mkdir spec/features
$ touch spec/features/musicians_feature_spec.rb
CONTROLLERS
$ touch app/controllers/musicians_controller.rb
VIEWS
$ mkdir app/views/musicians
$ touch app/views/musicians/new.html.erb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment