This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sanity tests for factories and persistence in db | |
# Makes sure you have not inadvertently hosed validation, and suchlike when models are changed | |
shared_examples_for 'a model' do |factory, factory_params = {}| | |
let(:model) { FactoryGirl.build(factory, factory_params) } | |
it 'can be persisted' do | |
expect(model).to be_valid | |
model.save! | |
expect(model).to be_persisted | |
end |
NewerOlder