metasploit_data_models 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6ba747bcd0d3492de23db914e7cbdea803f3905
4
- data.tar.gz: c5dff2b2706bd6227bb3f112d34c35e61bcc22df
3
+ metadata.gz: 4025dff28108e5c8947f6b6a3cf804d1a229fc2b
4
+ data.tar.gz: b628f7bfbb605dcf70be7ecf245e2398cb20f338
5
5
  SHA512:
6
- metadata.gz: 814abb84faf6a04671073b8f8c832925da43cf289ea91b035f2da13f99aa3ac3d78ca9a7b7c7f34edad76fe5c492f1d2624b2403d921061bcef7ec0153b7ca76
7
- data.tar.gz: ef0362446755bc899f074d38179423e4e977ca56efed00429b6b091eb1a3c4b01fbf53e32987bc404f073001f5086c795596cb0ba7e7c6bf5f71b80c5e674ef6
6
+ metadata.gz: b325373dd94bdde2d38d2389f9975670d8867bc9ccc922f047c5efebc054dcf3451c88bff8d2f8bf1486adc196da70c30c11121d105694448fa3ba5c0d274c70
7
+ data.tar.gz: 87cd515fbfd12d241290d56941cc20983a959fd113b71b7162af6cb5d5eec2a6d9da05e89013ff70476c1d1991e29dbb15f520f951dcca04f5a965a0ac39caca
@@ -71,7 +71,6 @@ class Mdm::Module::Detail < ActiveRecord::Base
71
71
  # @return [ActiveRecord::Relation<MetasploitDataModels::AutomaticExploitation::Match>]
72
72
  has_many :matches,
73
73
  :class_name => 'MetasploitDataModels::AutomaticExploitation::Match',
74
- :dependent => :destroy,
75
74
  :primary_key => :fullname,
76
75
  :foreign_key => :module_fullname,
77
76
  :inverse_of => :module_detail
@@ -10,7 +10,7 @@ module MetasploitDataModels
10
10
  # The minor version number, scoped to the {MAJOR} version number.
11
11
  MINOR = 2
12
12
  # The patch version number, scoped to the {MAJOR} and {MINOR} version numbers.
13
- PATCH = 1
13
+ PATCH = 2
14
14
 
15
15
  #
16
16
  # Module Methods
@@ -8,7 +8,7 @@ RSpec.describe MetasploitDataModels::AutomaticExploitation::Match, type: :model
8
8
 
9
9
  subject(:automatic_exploitation_match){ described_class.new }
10
10
 
11
- before(:each ) do
11
+ before(:each) do
12
12
  automatic_exploitation_match.matchable = vuln
13
13
  automatic_exploitation_match.module_fullname = module_detail.fullname
14
14
  automatic_exploitation_match.save!
@@ -17,7 +17,21 @@ RSpec.describe MetasploitDataModels::AutomaticExploitation::Match, type: :model
17
17
  it 'should point to the Mdm::Module::Detail with a fullname corresponding to #module_fullname' do
18
18
  expect(automatic_exploitation_match.module_detail).to eq(module_detail)
19
19
  end
20
+ end
21
+
22
+ describe "deleting the associated Mdm::Module::Detail" do
23
+ subject(:automatic_exploitation_match){ FactoryGirl.create(:automatic_exploitation_match) }
24
+ let(:match_id){ automatic_exploitation_match.id }
25
+
26
+ before(:each) do
27
+ automatic_exploitation_match.module_detail.destroy
28
+ end
20
29
 
30
+ it 'should still exist in the DB' do
31
+ the_match = MetasploitDataModels::AutomaticExploitation::Match.find(match_id)
32
+ expect(the_match).to_not be_blank
33
+ end
21
34
  end
35
+
22
36
  end
23
37
  end
@@ -2,5 +2,6 @@ FactoryGirl.define do
2
2
  factory :automatic_exploitation_match, :class => MetasploitDataModels::AutomaticExploitation::Match do
3
3
  association :module_detail, factory: :mdm_module_detail
4
4
  association :match_set, factory: :automatic_exploitation_match_set
5
+ association :matchable, factory: :mdm_vuln
5
6
  end
6
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metasploit_data_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Huckins
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-05-29 00:00:00.000000000 Z
14
+ date: 2015-06-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: metasploit-version
@@ -731,7 +731,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
731
731
  version: '0'
732
732
  requirements: []
733
733
  rubyforge_project:
734
- rubygems_version: 2.4.3
734
+ rubygems_version: 2.4.6
735
735
  signing_key:
736
736
  specification_version: 4
737
737
  summary: Database code for MSF and Metasploit Pro