Create temporary ActiveRecord models with Temping
Temping allows for the creation of temporary table-backed ActiveRecord models for use in tests. This is useful when writing ActiveRecord-extending plugins or for testing modules separate from their concrete implementations. The syntax for creating a model allows for any method call that can occur in a standard ActiveRecord::Base Model:
create_model :tests do
with_columns do |t|
t.string :test_string
end
validates_presence_of :test_string end</code>
Post a comment