Skip to content

Instantly share code, notes, and snippets.

@chrismo
Created March 5, 2013 05:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrismo/5088177 to your computer and use it in GitHub Desktop.
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