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)
| require 'spec_helper' | |
| describe Users::OauthCallbacksController, "handle facebook authentication callback" do | |
| describe "#annonymous user" do | |
| context "when facebook email doesn't exist in the system" do | |
| before(:each) do | |
| stub_env_for_omniauth | |
| get :facebook |
| When /^(?:|I )select "([^"]*)" from "([^"]*)"(?: within "([^"]*)")?$/ do |value, field, selector| | |
| with_scope(selector) do | |
| select(value, :from => field) | |
| # this is what changed .. 1) need to find the ID of the field that was passed in and then trigger a change event | |
| id = "#" + find_field(field)[:id] | |
| page.execute_script("$('#{id}').trigger('change');") | |
| end | |
| end |
| :+1: | |
| :-1: | |
| :airplane: | |
| :art: | |
| :bear: | |
| :beer: | |
| :bike: | |
| :bomb: | |
| :book: | |
| :bulb: |
| # autoload concerns | |
| module YourApp | |
| class Application < Rails::Application | |
| config.autoload_paths += %W( | |
| #{config.root}/app/controllers/concerns | |
| #{config.root}/app/models/concerns | |
| ) | |
| end | |
| end |
| def select_from_chosen(item_text, options) | |
| field = find_field(options[:from]) | |
| option_value = page.evaluate_script("$(\"##{field[:id]} option:contains('#{item_text}')\").val()") | |
| page.execute_script("$('##{field[:id]}').val('#{option_value}')") | |
| end |
| #!/bin/bash | |
| # | |
| # Report time to first byte for the provided URL using a cache buster to ensure | |
| # that we're measuring full cold-cache performance | |
| while (($#)); do | |
| echo $1 | |
| curl -so /dev/null -H "Pragma: no-cache" -H "Cache-Control: no-cache" \ | |
| -w "%{http_code}\tPre-Transfer: %{time_pretransfer}\tStart Transfer: %{time_starttransfer}\tTotal: %{time_total}\tSize: %{size_download}\n" \ | |
| "$1?`date +%s`" |
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)
| mr Marathi | |
| bs Bosnian | |
| ee_TG Ewe (Togo) | |
| ms Malay | |
| kam_KE Kamba (Kenya) | |
| mt Maltese | |
| ha Hausa | |
| es_HN Spanish (Honduras) | |
| ml_IN Malayalam (India) | |
| ro_MD Romanian (Moldova) |
by Jonathan Rochkind, http://bibwild.wordpress.com
Capistrano automates pushing out a new version of your application to a deployment location.
I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".
| =begin | |
| Notes | |
| ===== | |
| Labels: On the label you should put a "for" attribute if you're not using something like simple_form | |
| This helps capybara to find your field | |
| e.g. <label for="my_field_id">Some label</label> | |
| =end | |
| field = "Label on my field" | |
| value = "existing option in list" |