I have (belatedly) started testing my Rails app (a shopping website) with RSpec/capybara, using database cleaner to clear the database and Factory Girl to generate new objects for every test (like most people do). This works fine, and I do think it is a good idea to clear the data between tests.
However, it can get slow and (as far as I can figure out) a bit tedious to generate multiple instances of the same object. There are some objects that are always the same in my database, or that I will always generate an identical copy of for testing. For example, my Package
model, which defines the pricing and feature limits for a subscription package. It will probably never change.
Is there a way, with this configuration (please comment and specify if you require more info), to put certain instances of objects in the test database and exclude them from Database Cleaner, or any other way to keep permanent copies of specific objects in your test database?
This is mainly to increase testing speed.