This file contains hidden or 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
# Migration generator shortcuts. | |
# rails generate migration MyNewMigration | |
# rails generate migration add_fieldname_to_tablename fieldname:string | |
# rails generate model Product name:string description:text | |
# The set of available column types [:string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean] | |
# A migration is a subclass of ActiveRecord::Migration. You must implement the "up" and "down" (revert) methods. | |
# These are the handy methods available to a Migration: |
This file contains hidden or 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
#!/usr/bin/env bash | |
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz | |
mkdir vim && tar xzvf vim.tar.gz -C vim | |
export PATH=$PATH:/app/vim/bin |
This file contains hidden or 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
# Typically in Rails to use VCR we setup the RSpec config like so: | |
RSpec.configure do |config| | |
config.extend VCR::RSpec::Macros #deprecated | |
end | |
# This gives us access to the use_vcr_cassette method: | |
describe Reviewed::Article do | |
use_vcr_cassette 'article/grill' | |
end | |
This file contains hidden or 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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |