Skip to content

Instantly share code, notes, and snippets.

@jordanmaguire
Created June 26, 2012 01:29
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jordanmaguire/2992535 to your computer and use it in GitHub Desktop.
Save jordanmaguire/2992535 to your computer and use it in GitHub Desktop.
This is a helpful RSpec pattern I've been playing with lately with great success
let(:vehicle) { FactoryGirl.create(:vehicle, vehicle_attributes) }
let(:vehicle_attributes) { {} }
describe "#to_s"
subject { vehicle.to_s }
let(:vehicle_attributes) { {name: "Carzilla"} }
it { should == "Carzilla" }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment