Up front, I'm using:
- Ruby 2.3.1
- Rails 5
- rspec-rails 3.5
I've set up a mountable Rails engine with a polymorphic model that I want to use in other engines. The model class looks like this:
module Geo
class Location < ApplicationRecord
belongs_to :locatable, polymorphic: true
end
end
In my specs I'd like to make sure that I have a valid model, however, within the engine I have no other model that is associated with Geo::Location
.
How can I set up a dummy class for testing validity (belongs_to
require presence) or what are good testing strategies that you have used?