Skip to content

Instantly share code, notes, and snippets.

View karlentwistle's full-sized avatar

Karl Entwistle karlentwistle

View GitHub Profile
@karlentwistle
karlentwistle / alias_matchers.md
Created March 7, 2017 22:19 — forked from JunichiIto/alias_matchers.md
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
=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')
class Event < ActiveRecord::Base
has_many :artists
end
class Artist < ActiveRecord::Base
def self.make_me_an_artist
create! do |artist|

Heroku SSL Endpoint

Assumptions:

  • You want to enable SSL for your domain.
  • You want to go with RapidSSL.
  • Your domain name is www.domain.com during this example.
  • You want to encrypt requests for a single domain (no wildcard)
  • You want to apply this certificate to Heroku's SSL Endpoint
# config/routes.rb
resources :documents do
resources :versions, controller: "documents/versions" do
post :restore, on: :member
end
resource :lock, controller: "documents/locks"
end
#curl -L https://gist.github.com/karlentwistle/5029263/raw/84faa6a15a9c521533e33135090c1214c457f08d/chef_solo_bootstrap.sh | bash
aptitude -y update
echo "Installing RVM and Ruby dependencies"
sudo apt-get install -y build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion git-core libgdbm-dev pkg-config libffi-dev
echo "Installing RVM system-wide"
bash -c "bash <( curl -L https://github.com/wayneeseguin/rvm/raw/1.3.0/contrib/install-system-wide ) --version '1.3.0'"
cat >> /etc/profile <<'EOF'
# Load RVM if it is installed,
# first try to load user install