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/tddium.rake | |
namespace :tddium do | |
desc "tddium environment db setup task" | |
task :db_hook do | |
ENV['RAILS_ENV'] = 'test' | |
Rake::Task["db:create"].invoke | |
if File.exists?(File.join(Rails.root, "db", "schema.rb")) | |
Rake::Task['db:schema:load'].invoke | |
else | |
Rake::Task['db:migrate'].invoke |
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
# db/migrate/20110714024435_split_author.rb | |
class SplitAuthor < ActiveRecord::Migration | |
def self.up | |
Post.where(:author=>nil).each do |p| | |
author = Author.create!(:name => p.author_name, | |
:account_id => p.account_id) | |
p.author = author | |
p.save! | |
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
#!/bin/sh | |
set -e | |
bundle exec rake tddium:db:capture |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: delayed_job | |
# Required-Start: $all | |
# Required-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: | |
### END INIT INFO |
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
#config/tddium.yml | |
:tddium: | |
:pgsuper: 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
# config/tddium.yml | |
:tddium: | |
:sqlite: true | |
:mysql: false | |
:mysqlsuper: false |
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
# features/support/selenium_patch.rb | |
# This patch attempts to fix a race condition in the selenium web driver | |
# Reference: https://code.google.com/p/selenium/issues/detail?id=2099 | |
class Capybara::Selenium::Driver | |
def find(selector) | |
begin | |
browser.find_elements(:xpath, selector).map { |node| Capybara::Selenium::Node.new(self, node) } | |
rescue Selenium::WebDriver::Error::UnhandledError |
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
# features/step_definitions/web_steps.rb | |
# This replacement step works around an incompatibility between capybara-0.3.9 (or thereabouts) and selenium-webdriver >=2.5.0. | |
When /^(?:|I )select "([^"]*)" from "([^"]*)"(?: within "([^"]*)")?$/ do |value, field, selector| | |
with_scope(selector) do | |
# See https://github.com/jnicklas/capybara/issues/88 | |
# page.find_by_id(field).select(value) | |
if Capybara.current_session.mode == :selenium | |
select_node = page.find_by_id(field) |
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
# config/initializers/omniauth.rb | |
require 'openid/store/filesystem' | |
use OmniAuth::Strategies::OpenID, OpenID::Store::Filesystem.new(Dir.tmpdir) |
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
# config/environments/test.rb | |
require 'tmpdir' | |
config.cache_store = :file_store, File.join(Dir.tmpdir, "rails_cache") if ENV['TDDIUM'] |
OlderNewer