Skip to content

Instantly share code, notes, and snippets.

View opahk's full-sized avatar

Frank C. Schuetz opahk

  • San Francisco Bay Area
View GitHub Profile
@opahk
opahk / factory_girl_debugging.rb
Created March 15, 2012 12:34 — forked from dolzenko/factory_girl_debugging.rb
Commands to debug Factory Girl from console
require 'factory_girl_rails'
require 'rspec'
require 'rspec-rails'
include FactoryGirl::Syntax::Methods # make FG methods available at top level, so you can do `> create :user`
def reload_factories!
FactoryGirl.instance_variable_set(:@factories, nil) # => clear loaded factories/sequences
# FactoryGirl.instance_variable_set(:@sequences, nil)
Dir[Rails.root.join('spec/factories/*.rb')].each { |f| load f } # => loads factories again
@opahk
opahk / check threshold and complexity after running tests
Created August 21, 2014 12:41
code coverage build thresholds
bundle exec cane --no-doc --gte "path/to/coverage/covered_percent,99" --lte "path/to/coverage/missed_lines,28"
@opahk
opahk / gist:a2f6f469b11230059315
Created August 21, 2014 12:47
ruby/js testing tools
base
* simplecov
* rspec
* capybara
quality
* checker
* rails_best_practices
* jslint
* coffeelint