Skip to content

Instantly share code, notes, and snippets.

@sumskyi
Created September 11, 2012 08:58
Show Gist options
  • Save sumskyi/3697042 to your computer and use it in GitHub Desktop.
Save sumskyi/3697042 to your computer and use it in GitHub Desktop.
testing-your-factories-first for Fabricator gem (http://robots.thoughtbot.com/post/30994874643/testing-your-factories-first)
require 'spec_helper'
describe 'Fabricators' do
Fabrication::Support.find_definitions if Fabrication.schematics.empty?
Fabrication.schematics.schematics.keys.each do |fabrication|
it "The #{fabrication} fabrication is valid" do
f = Fabricate.build(fabrication)
f.should be_valid if f.respond_to?(:valid?)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment