This is a fairly common question, and there isn't a One True Answer.
These are the most common techniques:
| =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') |
| # RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
| # defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
| module Player | |
| describe MovieList, "with optional description" do | |
| it "is pending example, so that you can write ones quickly" | |
| it "is already working example that we want to suspend from failing temporarily" do | |
| pending("working on another feature that temporarily breaks this one") |
| require 'faraday' | |
| require 'net/http' | |
| require 'pp' | |
| # Repos: | |
| # https://github.com/technoweenie/faraday | |
| # https://github.com/pengwynn/faraday_middleware | |
| # Blog posts: | |
| # http://adventuresincoding.com/2010/09/writing-modular-http-client-code-with-faraday |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| #!/bin/bash | |
| ### BEGIN INIT INFO | |
| # Provides: sidekiq beta | |
| # Required-Start: $syslog $remote_fs | |
| # Required-Stop: $syslog $remote_fs | |
| # Should-Start: $local_fs | |
| # Should-Stop: $local_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: sidekiq beta - asynchronous rails |
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
| #!/usr/bin/env ruby | |
| # Validates that you don't commit forbidden keywords to the repo | |
| # You can skip this checking with 'git commit --no-verify' | |
| exit 0 if ARGV.include?('--no-verify') | |
| # Update this list with your own forbidden keywords | |
| KEYWORDS = %w(binding.pry console.log debugger) | |
| def red(text) "\033[31m#{text}\033[0m"; end |
Options included below:
docker-composebrewThis gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.