Skip to content

Instantly share code, notes, and snippets.

Capybara.register_driver :selenium_with_long_timeout do |app|
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 120
Capybara::Selenium::Driver.new(app, :browser => :firefox, :http_client => client)
end
Capybara.javascript_driver = :selenium_with_long_timeout
@drogus
drogus / gist:10368834
Last active August 29, 2015 13:58 — forked from qoobaa/gist:10368474
this.resource("restaurants")
this.resource("restaurant", { path: "/restaurants/:restaurant_id" }, function () {
this.resource("bookings", function () {
this.route("new");
});
this.resource("booking", { path: "/bookings/:booking_id" });
});
{
"payload": {
"id": 1,
"number": 1,
"status": null,
"started_at": null,
"finished_at": null,
"status_message": "Passed",
"commit": "62aae5f70ceee39123ef",
"branch": "master",
@drogus
drogus / README.md
Created December 12, 2012 16:36 — forked from svenfuchs/README.md

In your Gemfile add:

group :development, :test do
  gem 'micro_migrations', :git => 'git@gist.github.com:33e9f92c229eb808a4fa.git'
end

You might want to add something like this to the Rakefile of apps that use a gem that uses micro_migrations:

ENV['SCHEMA'] = "#{Gem.loaded_specs['your-gem-name'].full_gem_path}/db/schema.rb"

@drogus
drogus / Gemfile
Created October 17, 2012 22:07
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@drogus
drogus / config.ru
Created March 4, 2012 22:13
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
# We are not loading Active Record, nor the Assets Pipeline, etc.
# This could also be in your Gemfile.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
# The following lines should come as no surprise. Except by
require 'rubygems'
require 'dm-core'
DataMapper.setup(:default, 'sqlite3::memory:')
class Article
include DataMapper::Resource
property :id, Serial