Skip to content

Instantly share code, notes, and snippets.

@chrismo
Created March 5, 2013 05:11
Show Gist options
  • Select an option

  • Save chrismo/5088177 to your computer and use it in GitHub Desktop.

Select an option

Save chrismo/5088177 to your computer and use it in GitHub Desktop.
DIY fixture base class
class BaseFixture
def self.create(opts={})
fixture = self.new(opts)
fixture.save!
fixture
end
end
class UserFixture < BaseFixture
def self.new(opts={})
User.new({:first_name => 'Joe', :last_name => 'Bob'}.merge(opts))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment