This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails generate controller FooBars baz quux | |
rails destroy controller FooBars baz quux | |
rails generate model Foo bar:string baz:integer | |
rails destroy model Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rake db:migrate | |
rake db:rollback | |
rake db:migrate VERSION=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shoppertown::Application.routes.draw do | |
match '/benefits', to: 'content_pages#benefits' | |
match '/howto_buy', to: 'content_pages#howto_buy' | |
match '/howto_sell', to: 'content_pages#howto_sell' | |
match '/about', to: 'content_pages#about' | |
match '/contact', to: 'content_pages#contact' | |
match '/policies', to: 'content_pages#policies' | |
match '/legal', to: 'content_pages#legal' | |
authenticated :user do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails generate integration_test content_pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "Home page" do | |
it "should have the content 'Sample App'" do | |
visit '/static_pages/home' | |
page.should have_content('Sample App') | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group :test do | |
gem 'capybara', '1.1.2' | |
gem 'rb-fsevent', '0.9.1', :require => false | |
gem 'growl', '1.0.3' | |
end | |
(OS X users may have to install Growl and growlnotify as well) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support/core_ext' | |
# Ensures that Guard doesn’t run all the tests after a failing test passes | |
# (to speed up the Red- Green-Refactor cycle): | |
guard 'rspec', :version => 2, :all_after_pass => false do | |
. | |
. | |
. | |
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) do |m| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'spork' | |
Spork.prefork do | |
# Loading more in this block will cause your tests to run faster. However, | |
# if you change any configuration or code from libraries loaded here, you'll | |
# need to restart spork for it take effect. | |
# This file is copied to spec/ when you run 'rails generate rspec:install' | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITHOUT SPORK: | |
$ time bundle exec rspec spec/requests/static_pages_spec.rb | |
...... | |
6 examples, 0 failures | |
real 0m8.633s | |
user 0m7.240s | |
sys 0m1.068s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ guard init spork |