Guard watches a directory and runs commands when it sees changes to files.
This is great for automating your rspec tests!
Add guard and guard-rspec to your Gemfile
| class AppointmentsController < ApplicationController | |
| def index | |
| @appointments = Appointment.all | |
| end | |
| def show | |
| @appointment = Appointment.find(params[:id]) | |
| end | |
| def new |
| Backbone.Collection = { | |
| fetch: function() { | |
| var requestUrl; | |
| if (isAFunction(this.url)) { | |
| requestUrl = this.url(); | |
| } else { | |
| requestUrl = this.url; | |
| } | |
| --------------------------------------------------------------------------------------- | |
| #### If you want to create a new GIT repo + ADD travis-ci.org ##### | |
| -------------------------------------------------------------------------------------- | |
| 1.) cd into your app | |
| 2.) git init --> from inside your folder | |
| 3.) Create the new repo on Github | |
| (Below should show up after creating new Repo) | |
| * git remote add origin [email protected]:catm705/registry_app.git | |
| * git push -u origin master |
| language: ruby | |
| rvm: | |
| - 2.1.0 | |
| before_script: | |
| - "sh -e /etc/init.d/xvfb start" | |
| - "export DISPLAY=:99.0" | |
| - "export JASMINE_SPEC_FORMAT=documentation" | |
| env: | |
| - PG_USERNAME='postgres' | |
| script: |
| #Steps for Heroku | |
| git init | |
| git add . | |
| git commit -m "first commit" | |
| heroku create | |
| git push heroku master | |
| # add rails 12factorgem | |
| ruby -v | |
| declare a ruby version |
| <%= form_for :article do |f| %> | |
| <p> | |
| <%= f.label :title %><br> | |
| <%= f.text_field :title %> | |
| </p> | |
| <p> | |
| <%= f.label :text %><br> | |
| <%= f.text_area :text %> | |
| </p> |
| require 'spec_helper' | |
| describe "the site" do | |
| describe "new user visits homepage" do | |
| it "says Cappy App" do | |
| visit("/") | |
| expect(page).to have_content "Cappy App" | |
| end |
| gem 'rails_12factor' | |
| group :development, :test do | |
| gem 'pry-rails' | |
| gem 'rspec' | |
| gem 'rspec-rails' | |
| gem 'guard' | |
| gem 'guard-rspec' | |
| gem 'guard-bundler', require: false |
| development: &defaults | |
| adapter: postgresql | |
| encoding: unicode | |
| pool: 5 | |
| host: localhost | |
| username: <%= `echo $USER`.chomp %> | |
| password: | |
| database: <%= File.basename(Rails.root) %>_development | |
| test: |