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
Run all features: | |
`cucumber` | |
Run cucumber using selenium: | |
`cucumber -p selenium features` | |
TODO: we may be able to clean up the file locations using --exclude in the profiles |
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
#usage: Incident.new.should delegate(:batch_code, :to => :incident_batch) | |
Spec::Matchers.define :delegate do |method_name, options| | |
match do |delegator| | |
associated_receiver = options[:to] | |
expected_value = 'TEST' | |
receiver = Spec::Mocks::Mock.new(associated_receiver, method_name => expected_value) | |
##retrieval | |
delegator.stub!(associated_receiver => receiver) | |
delegator.send(method_name) == expected_value |
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
MAILTO=me@example.com | |
TIPS_ROOT=/home/user_name/projects/project1 | |
# m h dom mon dow command | |
*/1 * * * * $TIPS_ROOT/script/local_runner.sh script/ping_em_all.rb log/ping.log |
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 'rubygems' | |
require 'wirble' | |
#require 'utility_belt' #didn't play well with others, try again later. | |
require 'hirb' #nice console formatting | |
Wirble.init | |
Wirble.colorize | |
Hirb.enable | |
puts "`include RailsHelper` for named_urls, helpers, etc." |
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
Transform /^table:.*$/ do |table| | |
#convert empty strings to nil (reverses #470) | |
table.hashes.each do |hash| | |
hash.each do |key, value| | |
hash[key] = value.empty? ? nil : value | |
end | |
end | |
table | |
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
puts "`include RailsHelper` for named_urls, helpers, etc." | |
module RailsHelper | |
def self.included(base) | |
##from: http://kpumuk.info/ruby-on-rails/memo-6-using-named-routes-and-url_for-outside-the-controller-in-ruby-on-rails/ | |
## this is slow because all routes and resources being calculated now | |
base.send('include', ActionController::UrlWriter) | |
base.default_url_options[:host] = 'www.example.com' | |
DatabaseCleaner.strategy = :truncation, {:except => SeedData.seed_tables} | |
puts "You can now utilize named_urls & DatabaseCleaner.clean" |
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
#When I edit Jurisdiction/Location:L1 | |
When /^I edit (.*)(?:\/)(.+):(.+)$/ do |requested_parent_model, requested_model, default_identifier| |
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
#save to ~/.rake/rspec_recent.rake | |
@usage: `rake -g spec:recent` | |
# Grab recently touched specs | |
#from: http://nullcreations.net/entries/general/rspec-on-rails-rake-task-for-recent-specs | |
#TODO: should this grab list from svn? affter we remove externals? | |
def recent_specs(touched_since) | |
recent_specs = FileList['app/**/*'].map do |path| | |
if File.mtime(path) > touched_since |
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 'json' | |
$log_filename ||= File.expand_path(File.join("..", "ruby.log.json"), File.dirname(__FILE__)) | |
begin | |
if !File.exist?($log_filename) | |
File.open($log_filename, "w") do |f| | |
f.write "[" | |
end | |
end |
OlderNewer