No commit activity in last 3 years
No release in over 3 years
Manage your FactoryGirl for create a unique instance of model associations and integrate with rspec
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Welcome to Instance Factory

Use current object for associations, preventing FactoryGirl creates a new one record in database. Works with FactoryGirl, RSpec and Minitest.

Getting Started

From rubygems:

Manually

gem install instance-factory

Gemfile

gem "instance-factory"

From source code:

git clone git@github.com:vgsantoniazzi/instance-factory.git
cd instance-factory
gem build --verbose instance-factory.gemspec
gem install instance-factory-version.gem

Usage

To include helper on FactoryGirl

FactoryGirl::SyntaxRunner.send(:include, InstanceFactory)

Adjust your spec_helper

RSpec.configure do |config|
  config.include InstanceFactory

  config.after(:each) do
    instance_factory_clear!
  end
end

Or to include on default test of rails 4

class ActiveSupport::TestCase
  include InstanceFactory
end

after :each do
  instance_factory_clear!
end

Contributing

I ❤️ Open source!

Follow github guides for forking a project

Follow github guides for contributing open source

Code status

Build Status

License

Gem is released under the MIT license.