This file contains 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
> if [[ "$RUBY_VERSION" == "jruby-19" ]]; then export export PROJECT_JRUBY_OPTS=( --1.9 ); fi | |
> rvm use $RUBY_VERSION |
This file contains 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
> irb | |
1.9.3p0 :001 > a | |
NameError: undefined local variable or method `a' for main:Object | |
from (irb):1 | |
from /Users/dnagir/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<main>' | |
1.9.3p0 :002 > b | |
NameError: undefined local variable or method `b' for main:Object | |
from (irb):2 | |
from /Users/dnagir/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<main>' | |
1.9.3p0 :003 > a = b |
This file contains 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
# Controller spec using plain old matchers | |
describe "#create" do | |
let(:participation) { stub 'Participation' } | |
let(:params) { {:participation => {}} } | |
before { InviteUser.stub(:into_company_by_params => participation) } | |
context "with success" do | |
before { participation.stub(:valid? => true) } |
This file contains 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
ENV["RAILS_ENV"] ||= 'test' | |
cur_dir = File.expand_path(File.dirname(__FILE__) + '/..') | |
$LOAD_PATH << "#{cur_dir}" | |
if defined? Bundler | |
# Most likely going with the full env | |
require 'spec_helper' | |
else | |
$LOAD_PATH << "#{cur_dir}/app/models" |
This file contains 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
# lib/tasks/ci.rake | |
require 'nokogiri' | |
desc "Run everything on the CI server with all its outcomes (deploy etc)" | |
task :ci do | |
Rake::Task['spec'].invoke | |
ensure_test_coverage 99 | |
Rake::Task['cucumber'].invoke | |
# TODO: Figure out how to run Jasminerice https://github.com/bradphelan/jasminerice/issues/31 |
This file contains 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 'capybara/util/timeout' | |
# Rewriting the https://github.com/jnicklas/capybara/blob/master/lib/capybara/util/timeout.rb | |
# Instead of raising timeout error, print the response info | |
module Capybara | |
class << self | |
## | |
# Provides timeout similar to standard library Timeout, but avoids threads |
This file contains 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
module HasSymbolicField | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Defining (all below are equivalent): | |
# - has_symbolic_field :status, [:active, :pending] | |
# - has_symbolic_field :status, :active => 'Active', :pending => 'Pending' | |
# - has_symbolic_field :status, :active => 'Active', :pending => nil | |
# Accessing: | |
# - it.status # :available |
This file contains 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 File.expand_path('../boot', __FILE__) | |
# Pick the frameworks you want: | |
require "active_record/railtie" | |
require "action_controller/railtie" | |
require "action_mailer/railtie" | |
require "active_resource/railtie" | |
require "sprockets/railtie" | |
# require "rails/test_unit/railtie" |
This file contains 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
module UtilitySteps | |
def wait_for_page_load | |
page.wait_until do | |
if Capybara.current_driver != :rack_test | |
page.has_css?('body.dom-loaded') and !has_pending_ajax_request? | |
else | |
true | |
end | |
end |
This file contains 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
GEM | |
remote: https://rubygems.org/ | |
specs: | |
actionmailer (3.2.1) | |
actionpack (= 3.2.1) | |
mail (~> 2.4.0) | |
actionpack (3.2.1) | |
activemodel (= 3.2.1) | |
activesupport (= 3.2.1) | |
builder (~> 3.0.0) |