Sha256: 022f6848f0fa0e101efd522fb8d0d26dce16a9377e64304b13f035a630d4bf87
Contents?: true
Size: 1.56 KB
Versions: 8
Compression:
Stored size: 1.56 KB
Contents
RSpec.describe Metasploit::Model::Search::Operation::Null, type: :model do context 'validation' do context 'operator' do context 'null' do let(:error) do I18n.translate( 'metasploit.model.errors.models.metasploit/model/search/operation/null.attributes.operator.type', type: Metasploit::Model::Search::Operator::Null ) end let(:errors) do operation.errors[:operator] end let(:klass) do Class.new end let(:operation) do described_class.new( :operator => operator ) end let(:operator) do operator_class.new( :klass => klass ) end before(:each) do operation.valid? end context 'with Metasploit::Model::Search::Operator::Null' do let(:operator_class) do Metasploit::Model::Search::Operator::Null end it 'should not record error' do expect(errors).not_to include(error) end end context 'without Metasploit::Model::Search::Operator::Null' do let(:operator_class) do Metasploit::Model::Search::Operator::Base end it 'should record error' do expect(errors).to include(error) end it 'should have no other errors, so that it would be valid without this type check on operator' do expect(operation.errors.size).to eq(1) end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems