FactoryBot skip_create to help creating POROs
If you are tempted to use FactoryBot
to build instances of simple ruby objects (instead of ActiveRecords::Base
descendants), you might find skip_create
useful. Without that your factories linter will yield exception.
FactoryGirl.define do
factory :cloudbeds_room_type, class: Cloudbeds::RoomType do
skip_create
sequence(:property_id)
room_rate { 52.5 }
name 'Sample room type'
end
end
Tweet