Sha256: d673d4ba6c0f9bc174f92ae98ef0d01f4c3ebe0eee8f8218aefce77e27f56b6f
Contents?: true
Size: 1.29 KB
Versions: 9
Compression:
Stored size: 1.29 KB
Contents
RSpec.describe MetasploitDataModels::AutomaticExploitation::Match, type: :model do it_should_behave_like 'Metasploit::Concern.run' describe "associations" do describe "connecting to a Mdm::Module::Detail" do let(:vuln){ FactoryGirl.create(:mdm_vuln) } let(:module_detail){FactoryGirl.create(:mdm_module_detail)} subject(:automatic_exploitation_match){ described_class.new } before(:each) do automatic_exploitation_match.matchable = vuln automatic_exploitation_match.module_fullname = module_detail.fullname automatic_exploitation_match.save! end it 'should point to the Mdm::Module::Detail with a fullname corresponding to #module_fullname' do expect(automatic_exploitation_match.module_detail).to eq(module_detail) end end describe "deleting the associated Mdm::Module::Detail" do subject(:automatic_exploitation_match){ FactoryGirl.create(:automatic_exploitation_match) } let(:match_id){ automatic_exploitation_match.id } before(:each) do automatic_exploitation_match.module_detail.destroy end it 'should still exist in the DB' do the_match = MetasploitDataModels::AutomaticExploitation::Match.find(match_id) expect(the_match).to_not be_blank end end end end
Version data entries
9 entries across 9 versions & 1 rubygems