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
<!doctype html> | |
/[if IEMobile 7 ] <html class="no-js iem7"> | |
/ [if (gt IEMobile 7)|!(IEMobile)]><! | |
%html.no-js | |
/ <![endif] | |
%head | |
%meta{:charset => "utf-8"} | |
%title | |
%meta{:content => "", :name => "description"} | |
%meta{:content => "", :name => "author"} |
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
<html> | |
<head> | |
<script src="javascripts/jquery.js" type="text/javascript" charset="utf-8"></script> | |
<script src="javascripts/ember.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript" charset="utf-8"> | |
App = Ember.Application.extend(); | |
App.Node = Ember.Object.extend({ | |
name: null, |
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
# 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") |
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') |
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
# coding: utf-8 | |
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
rescue_from Exception, :with => :handle_exceptions | |
private | |
def handle_exceptions(e) | |
case e | |
when CanCan::AccessDenied |
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
Upgrading to homebrew postgresql 9.1.1 from 9.0.x | |
* Copy the old data | |
mv -R /usr/local/var/postgres/ /usr/local/var/postgres-901 | |
* Create a new database using 9.1.1 | |
/usr/local/Cellar/postgresql/9.1.1/bin/initdb /usr/local/var/postgres |
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
require './test/selenium_test_helper' | |
class ExampleAdminTest < ActionController::IntegrationTest | |
# assemble basic test data via FactoryGirl, etc... | |
setup :prep_test_data, :visit_admin | |
test 'basic application operations' do | |
click_link "Show Archived Positions" | |
assert page.has_content?("Wooden Widget Maker") |
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
page.find('#applicant_viewer .notes-tab').click |
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
# Setup all the main constructs of a selenium/capybara instance | |
ENV["RAILS_ENV"] = "test" | |
require "#{Rails.root}/config/environment" | |
require 'rails/test_help' | |
require "capybara/rails" | |
require 'database_cleaner' | |
require 'capybara/dsl' | |
require 'factory_girl_rails' | |
require 'active_support/all' | |
require 'active_support/test_case' |
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
$ RAILS_ENV=test rails console | |
Loading test environment (Rails 3.2.8) | |
1.9.3p125 :001 > load 'test/capybara_irb.rb' | |
1.9.3p125 :002 > prep_test_data # this is typically run by my tests as setup :prep_test_data... | |
################################################################ | |
Factory Girl pumps out all my required models to get rolling... | |
################################################################ | |
1.9.3p125 :205 > visit '/admin' # this opens Firefox via the Selenium WebDriver | |
1.9.3p125 :206 > find('.x-some .y-selector').click # --> returns true if element is found, plus you can *see* happen |
OlderNewer