What Can We Do in a Model Test?

An RSpec file in the spec/models directory is automatically of type: :model, which gives you…not a whole lot of new behavior, actually. There is an add-on gem called rspec-activemodel-mocks, which is maintained by the RSpec core team and includes some mock-object tools specific to use with ActiveModel.

Get Rails 4 Test Prescriptions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.