Skip to content

Instantly share code, notes, and snippets.

View swanson's full-sized avatar
😈

matt swanson swanson

😈
View GitHub Profile

Faster Rails tests

Feedback loop speed in one of the biggest contributing factors to overall development time. The faster you get results, the faster you can move on to other things. A fast enough test suite is therefore critical to teams' success, and is worth investing some time at the beginning to save in the long run.

Below is a list of techniques for speeding up a Rails test suite. It is not comprehensive, but should definitely provide some quick wins. This list of techniques assumes you're using minitest, but most everything should translate over to rspec by simply replacing test/test_helper.rb with spec/spec_helper.rb.

@jodosha
jodosha / Gemfile
Last active December 9, 2020 15:09
Full stack Lotus application example
source 'https://rubygems.org'
gem 'rake'
gem 'lotus-router'
gem 'lotus-controller'
gem 'lotus-view'
group :test do
gem 'rspec'
gem 'capybara'
# I don't really see any services here. What I see is:
# - Normal HTTP boundary stuff (params flash, redirect).
# - Model creation and retrieval.
# - Warden manipulation, which is an odd done but smells like boundary.
#
# I left all of the HTTP boundary stuff in the controller (and only the
# controller). I moved the model creation/retrieval into simple class methods
# in the models. I moved the warden manipulation stuff into
# ApplicationController (with caveats that I'll discuss inline).
#
@swanson
swanson / gist:4342538
Last active December 9, 2015 23:08
H&&H
hacks
proposaljet
paperplane
piratemetrics
happenings
Ryan Schade's quarterly dev talk thing?? - no updates
David Hussman @ SEP??
http://www.meetup.com/Indianapolis-Code-and-Coffee/ (backup plan)
SpeakEasy Oh Shit legal series
@hammerdr
hammerdr / gist:1868144
Created February 20, 2012 06:35
Hammer's Code Critique Rules
1. We evaluate the code from the beginner's perspective. We can assume
mediocre Ruby and mediocre Rails knowledge but we try to look at the
code as if it is the first time we have seen it. This allows us to try
to bring fresh perspectives to the code (and, hopefully, improve the
code for people that are reading it for the first time).
2. As in a retrospective, we assume that everyone involved was doing
the best that they can with the knowledge that they had at the time.
This is not a session to assign blame or to even feel guilty. We are
all trying to improve. That being said, it is expected that the
$(function(){
// Namespace the application
var khepin = {};
// Todo Model
khepin.Todo = Backbone.Model.extend({
defaults: {
task: null,
done: false
@wynst
wynst / README.MD
Created February 25, 2010 11:19
A Thor Task to unwatch *all* Github watched repositories (excluding owned) and optionally export to delicious.

A Thor Task to unwatch all Github watched repositories (excluding owned) and optionally export to delicious.

Sorry Github, for I have sinned. I use the Watch feature as a bookmarker.

Install required gems:

gem install thor rest-client

Use it as such: