require 'rails_helper' module Logistics module Core RSpec.describe OperationDocument, type: :model do it 'has a valid factory' do expect(create(:operation_document)).to be_valid end it 'is invalid with no document' do expect(build(:operation_document, :document => '')).not_to be_valid end it 'is invalid with no original' do expect(build(:operation_document, :original => nil)).not_to be_valid end it 'is invalid with no copy' do expect(build(:operation_document, :copy => nil)).not_to be_valid end it 'is invalid with no certified' do expect(build(:operation_document, :certified => nil)).not_to be_valid end it 'is invalid with no operation' do expect(build(:operation_document, :operation => nil)).not_to be_valid end end end end