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
RSpec.configure do |config| | |
config.before(:all) do | |
clear_database | |
end | |
end | |
def clear_database | |
Mongoid.master.collections.select {|c| c.name !~ /system/ }.each(&:drop) | |
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
def access_token | |
@access_token ||= begin | |
twitter_request = session['twitter_request'] | |
oauth.authorize_from_request(twitter_request.token, twitter_request.secret, params['oauth_verifier']) | |
oauth.access_token | |
end | |
end | |
def oauth(opts = {}) | |
@oauth ||= ::Twitter::OAuth.new(config.twitter_api_keys['token'], config.twitter_api_keys['secret'], opts) |
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
git log --all -M -C --name-only | grep -E '^(app|lib)/' | sort | uniq -c | sort |
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
# Add this to more_web_steps.rb | |
# Selenium docs: http://code.google.com/p/selenium/wiki/RubyBindings#Javascript_Alert/Confirm today! | |
When /^I (accept|dismiss) the "([^"]*)" alert$/ do |action, text| | |
alert = page.driver.browser.switch_to.alert | |
alert.text.should eq(text) | |
alert.send(action) | |
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
git_completion=`brew --prefix git`/etc/bash_completion.d/git-completion.bash | |
if [ -f $git_completion ] ; then source $git_completion; fi |
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
# Setup the following in your heroku config vars: | |
# See http://blog.leshill.org/blog/2010/11/02/heroku-environment-variables.html for an idea on how to do it | |
HEROKU_APP: poh-dev | |
HEROKU_USER: heroku@infbio.com | |
HEROKU_PASSWORD: replace_me | |
# Gemfile | |
gem 'heroku', '>= 1.19.1' | |
gem 'resque' | |
# Use our fork until our fix is merged. |
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
# Git completion | |
git_completion=/usr/local/etc/bash_completion.d/git-completion.bash | |
if [ -f $git_completion ] ; then source $git_completion; fi |
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
test: &test | |
<<: *defaults | |
database: app_test<%=ENV["TEST_ENV_NUMBER"]%> |
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
class Capybara::RackTest::Browser | |
def build_rack_mock_session | |
Rack::MockSession.new(app, URI.parse(current_host).host) | |
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
#app/controllers/application_controller.rb | |
class ApplicationController < ActionController::Base | |
before_filter :scheduler_redirect if ENV['SCHEDULER_REDIRECT'] | |
# ... | |
private | |
def scheduler_redirect |