metasploit_data_models 2.0.17 → 3.0.0

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.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.travis.yml +1 -1
  4. data/Gemfile +3 -8
  5. data/lib/mdm/host/operating_system_normalization.rb +2 -1
  6. data/lib/metasploit_data_models/engine.rb +7 -7
  7. data/lib/metasploit_data_models/version.rb +1 -1
  8. data/metasploit_data_models.gemspec +3 -1
  9. data/spec/app/models/mdm/client_spec.rb +3 -3
  10. data/spec/app/models/mdm/cred_spec.rb +34 -34
  11. data/spec/app/models/mdm/event_spec.rb +9 -9
  12. data/spec/app/models/mdm/exploit_attempt_spec.rb +5 -5
  13. data/spec/app/models/mdm/exploited_host_spec.rb +3 -3
  14. data/spec/app/models/mdm/host_detail_spec.rb +4 -4
  15. data/spec/app/models/mdm/host_spec.rb +47 -47
  16. data/spec/app/models/mdm/host_tag_spec.rb +5 -5
  17. data/spec/app/models/mdm/listener_spec.rb +12 -12
  18. data/spec/app/models/mdm/loot_spec.rb +8 -8
  19. data/spec/app/models/mdm/module/action_spec.rb +2 -2
  20. data/spec/app/models/mdm/module/arch_spec.rb +2 -2
  21. data/spec/app/models/mdm/module/author_spec.rb +3 -3
  22. data/spec/app/models/mdm/module/detail_spec.rb +71 -71
  23. data/spec/app/models/mdm/module/mixin_spec.rb +2 -2
  24. data/spec/app/models/mdm/module/platform_spec.rb +2 -2
  25. data/spec/app/models/mdm/module/ref_spec.rb +5 -5
  26. data/spec/app/models/mdm/module/target_spec.rb +2 -2
  27. data/spec/app/models/mdm/nexpose_console_spec.rb +15 -15
  28. data/spec/app/models/mdm/note_spec.rb +11 -11
  29. data/spec/app/models/mdm/ref_spec.rb +6 -6
  30. data/spec/app/models/mdm/route_spec.rb +3 -3
  31. data/spec/app/models/mdm/service_spec.rb +20 -20
  32. data/spec/app/models/mdm/session_event_spec.rb +3 -3
  33. data/spec/app/models/mdm/session_spec.rb +14 -14
  34. data/spec/app/models/mdm/tag_spec.rb +12 -12
  35. data/spec/app/models/mdm/task_cred_spec.rb +6 -6
  36. data/spec/app/models/mdm/task_host_spec.rb +6 -6
  37. data/spec/app/models/mdm/task_service_spec.rb +6 -6
  38. data/spec/app/models/mdm/task_session_spec.rb +6 -6
  39. data/spec/app/models/mdm/task_spec.rb +3 -3
  40. data/spec/app/models/mdm/user_spec.rb +3 -3
  41. data/spec/app/models/mdm/vuln_attempt_spec.rb +4 -4
  42. data/spec/app/models/mdm/vuln_detail_spec.rb +3 -3
  43. data/spec/app/models/mdm/vuln_ref_spec.rb +4 -4
  44. data/spec/app/models/mdm/vuln_spec.rb +20 -20
  45. data/spec/app/models/mdm/web_form_spec.rb +3 -3
  46. data/spec/app/models/mdm/web_page_spec.rb +4 -4
  47. data/spec/app/models/mdm/web_site_spec.rb +15 -15
  48. data/spec/app/models/mdm/web_vuln_spec.rb +4 -4
  49. data/spec/app/models/mdm/workspace_spec.rb +25 -25
  50. data/spec/app/models/metasploit_data_models/automatic_exploitation/match_result_spec.rb +4 -4
  51. data/spec/app/models/metasploit_data_models/automatic_exploitation/match_set_spec.rb +2 -2
  52. data/spec/app/models/metasploit_data_models/automatic_exploitation/match_spec.rb +3 -3
  53. data/spec/app/models/metasploit_data_models/automatic_exploitation/run_spec.rb +5 -5
  54. data/spec/app/models/metasploit_data_models/module_run_spec.rb +3 -3
  55. data/spec/app/models/metasploit_data_models/search/visitor/includes_spec.rb +4 -8
  56. data/spec/app/models/metasploit_data_models/search/visitor/joins_spec.rb +12 -12
  57. data/spec/app/models/metasploit_data_models/search/visitor/relation_spec.rb +16 -16
  58. data/spec/app/models/metasploit_data_models/search/visitor/where_spec.rb +3 -3
  59. data/spec/dummy/config/environments/test.rb +1 -1
  60. data/spec/dummy/db/structure.sql +2 -2
  61. data/spec/factories/mdm/addresses.rb +2 -2
  62. data/spec/factories/mdm/clients.rb +2 -2
  63. data/spec/factories/mdm/creds.rb +2 -2
  64. data/spec/factories/mdm/events.rb +3 -3
  65. data/spec/factories/mdm/exploit_attempts.rb +2 -2
  66. data/spec/factories/mdm/exploited_hosts.rb +1 -1
  67. data/spec/factories/mdm/fingerprints/nessus_fingerprints.rb +2 -2
  68. data/spec/factories/mdm/fingerprints/nexpose_fingerprints.rb +2 -2
  69. data/spec/factories/mdm/fingerprints/nmap_fingerprints.rb +2 -2
  70. data/spec/factories/mdm/fingerprints/retina_fingerprints.rb +2 -2
  71. data/spec/factories/mdm/fingerprints/session_fingerprints.rb +2 -2
  72. data/spec/factories/mdm/host_details.rb +2 -2
  73. data/spec/factories/mdm/host_tags.rb +2 -2
  74. data/spec/factories/mdm/hosts.rb +2 -2
  75. data/spec/factories/mdm/listeners.rb +2 -2
  76. data/spec/factories/mdm/loots.rb +2 -2
  77. data/spec/factories/mdm/module/actions.rb +2 -2
  78. data/spec/factories/mdm/module/archs.rb +2 -2
  79. data/spec/factories/mdm/module/authors.rb +2 -2
  80. data/spec/factories/mdm/module/details.rb +1 -1
  81. data/spec/factories/mdm/module/mixins.rb +2 -2
  82. data/spec/factories/mdm/module/platforms.rb +2 -2
  83. data/spec/factories/mdm/module/refs.rb +2 -2
  84. data/spec/factories/mdm/module/targets.rb +2 -2
  85. data/spec/factories/mdm/nexpose_consoles.rb +2 -2
  86. data/spec/factories/mdm/notes.rb +2 -2
  87. data/spec/factories/mdm/refs.rb +2 -2
  88. data/spec/factories/mdm/routes.rb +2 -2
  89. data/spec/factories/mdm/services.rb +3 -3
  90. data/spec/factories/mdm/session_events.rb +1 -1
  91. data/spec/factories/mdm/sessions.rb +2 -2
  92. data/spec/factories/mdm/tags.rb +2 -2
  93. data/spec/factories/mdm/task.rb +2 -2
  94. data/spec/factories/mdm/task_creds.rb +2 -2
  95. data/spec/factories/mdm/task_hosts.rb +2 -2
  96. data/spec/factories/mdm/task_services.rb +2 -2
  97. data/spec/factories/mdm/task_sessions.rb +2 -2
  98. data/spec/factories/mdm/users.rb +2 -2
  99. data/spec/factories/mdm/vuln_attempts.rb +2 -2
  100. data/spec/factories/mdm/vuln_details.rb +2 -2
  101. data/spec/factories/mdm/vuln_refs.rb +2 -2
  102. data/spec/factories/mdm/vulns.rb +2 -2
  103. data/spec/factories/mdm/web_forms.rb +1 -1
  104. data/spec/factories/mdm/web_pages.rb +2 -2
  105. data/spec/factories/mdm/web_sites.rb +2 -2
  106. data/spec/factories/mdm/web_vulns.rb +2 -2
  107. data/spec/factories/mdm/workspaces.rb +2 -2
  108. data/spec/factories/metasploit_data_models/automatic_exploitation/match_results.rb +1 -1
  109. data/spec/factories/metasploit_data_models/automatic_exploitation/match_sets.rb +2 -2
  110. data/spec/factories/metasploit_data_models/automatic_exploitation/matches.rb +1 -1
  111. data/spec/factories/metasploit_data_models/automatic_exploitation/runs.rb +1 -1
  112. data/spec/factories/module_runs.rb +1 -1
  113. data/spec/spec_helper.rb +2 -2
  114. data.tar.gz.sig +0 -0
  115. metadata +7 -7
  116. metadata.gz.sig +0 -0
@@ -41,29 +41,29 @@ RSpec.describe Mdm::Service, type: :model do
41
41
  context 'scopes' do
42
42
  context "inactive" do
43
43
  it "should exclude open services" do
44
- open_service = FactoryGirl.create(:mdm_service, :state => 'open')
44
+ open_service = FactoryBot.create(:mdm_service, :state => 'open')
45
45
  expect(Mdm::Service.inactive).not_to include(open_service)
46
46
  end
47
47
  end
48
48
 
49
49
  context "with_state open" do
50
50
  it "should exclude closed services" do
51
- closed_service = FactoryGirl.create(:mdm_service, :state => 'closed')
51
+ closed_service = FactoryBot.create(:mdm_service, :state => 'closed')
52
52
  expect(Mdm::Service.with_state('open')).not_to include(closed_service)
53
53
  end
54
54
  end
55
55
 
56
56
  context 'search' do
57
57
  it 'should find only services that match for \'tcp\'' do
58
- tcp_service = FactoryGirl.create(:mdm_service, proto: 'tcp')
59
- udp_service = FactoryGirl.create(:mdm_service, proto: 'udp')
58
+ tcp_service = FactoryBot.create(:mdm_service, proto: 'tcp')
59
+ udp_service = FactoryBot.create(:mdm_service, proto: 'udp')
60
60
  search_results = Mdm::Service.search('tcp')
61
61
  expect(search_results).to include(tcp_service)
62
62
  expect(search_results).not_to include(udp_service)
63
63
  end
64
64
 
65
65
  it 'should query host name of services' do
66
- service = FactoryGirl.create(:mdm_service)
66
+ service = FactoryBot.create(:mdm_service)
67
67
  host_name = service.host.name
68
68
  expect(Mdm::Service.search(host_name)).to include(service)
69
69
  end
@@ -75,14 +75,14 @@ RSpec.describe Mdm::Service, type: :model do
75
75
  include_context 'Rex::Text'
76
76
 
77
77
  it 'should call #normalize_host_os' do
78
- svc = FactoryGirl.create(:mdm_service)
78
+ svc = FactoryBot.create(:mdm_service)
79
79
  expect(svc).to receive(:normalize_host_os)
80
80
  svc.run_callbacks(:save)
81
81
  end
82
82
 
83
83
  it 'should include recog data when there is a match' do
84
- host = FactoryGirl.create(:mdm_host)
85
- FactoryGirl.create(
84
+ host = FactoryBot.create(:mdm_host)
85
+ FactoryBot.create(
86
86
  :mdm_service,
87
87
  :host => host,
88
88
  :name => 'ftp',
@@ -93,8 +93,8 @@ RSpec.describe Mdm::Service, type: :model do
93
93
  end
94
94
 
95
95
  it 'should not include recog data when there is not a match' do
96
- host = FactoryGirl.create(:mdm_host)
97
- FactoryGirl.create(
96
+ host = FactoryBot.create(:mdm_host)
97
+ FactoryBot.create(
98
98
  :mdm_service,
99
99
  :host => host,
100
100
  :name => 'ftp',
@@ -107,14 +107,14 @@ RSpec.describe Mdm::Service, type: :model do
107
107
 
108
108
  context 'factory' do
109
109
  it 'should be valid' do
110
- service = FactoryGirl.build(:mdm_service)
110
+ service = FactoryBot.build(:mdm_service)
111
111
  expect(service).to be_valid
112
112
  end
113
113
  end
114
114
 
115
115
  context '#destroy' do
116
116
  it 'should successfully destroy the object' do
117
- service = FactoryGirl.create(:mdm_service)
117
+ service = FactoryBot.create(:mdm_service)
118
118
  expect {
119
119
  service.destroy
120
120
  }.to_not raise_error
@@ -179,38 +179,38 @@ RSpec.describe Mdm::Service, type: :model do
179
179
 
180
180
  context 'port' do
181
181
  it 'should require a port' do
182
- portless_service= FactoryGirl.build(:mdm_service, :port => nil)
182
+ portless_service= FactoryBot.build(:mdm_service, :port => nil)
183
183
  expect(portless_service).not_to be_valid
184
184
  expect(portless_service.errors[:port]).to include("is not a number")
185
185
  end
186
186
 
187
187
  it 'should not be valid for out-of-range numbers' do
188
- out_of_range = FactoryGirl.build(:mdm_service, :port => 70000)
188
+ out_of_range = FactoryBot.build(:mdm_service, :port => 70000)
189
189
  expect(out_of_range).not_to be_valid
190
190
  expect(out_of_range.errors[:port]).to include("is not included in the list")
191
191
  end
192
192
 
193
193
  it 'should not be valid for port 0' do
194
- out_of_range = FactoryGirl.build(:mdm_service, :port => 0)
194
+ out_of_range = FactoryBot.build(:mdm_service, :port => 0)
195
195
  expect(out_of_range).not_to be_valid
196
196
  expect(out_of_range.errors[:port]).to include("is not included in the list")
197
197
  end
198
198
 
199
199
  it 'should not be valid for decimal numbers' do
200
- out_of_range = FactoryGirl.build(:mdm_service, :port => 5.67)
200
+ out_of_range = FactoryBot.build(:mdm_service, :port => 5.67)
201
201
  expect(out_of_range).not_to be_valid
202
202
  expect(out_of_range.errors[:port]).to include("must be an integer")
203
203
  end
204
204
 
205
205
  it 'should not be valid for a negative number' do
206
- out_of_range = FactoryGirl.build(:mdm_service, :port => -8)
206
+ out_of_range = FactoryBot.build(:mdm_service, :port => -8)
207
207
  expect(out_of_range).not_to be_valid
208
208
  expect(out_of_range.errors[:port]).to include("is not included in the list")
209
209
  end
210
210
  end
211
211
 
212
212
  subject(:mdm_service) {
213
- FactoryGirl.build(:mdm_service)
213
+ FactoryBot.build(:mdm_service)
214
214
  }
215
215
 
216
216
  it 'validate port is only an integer' do
@@ -220,8 +220,8 @@ RSpec.describe Mdm::Service, type: :model do
220
220
  it { is_expected.to validate_inclusion_of(:proto).in_array(described_class::PROTOS) }
221
221
 
222
222
  context 'when a duplicate service already exists' do
223
- let(:service1) { FactoryGirl.create(:mdm_service)}
224
- let(:service2) { FactoryGirl.build(:mdm_service, :host => service1.host, :port => service1.port, :proto => service1.proto )}
223
+ let(:service1) { FactoryBot.create(:mdm_service)}
224
+ let(:service2) { FactoryBot.build(:mdm_service, :host => service1.host, :port => service1.port, :proto => service1.proto )}
225
225
  it 'is not valid' do
226
226
  expect(service2).to_not be_valid
227
227
  end
@@ -7,14 +7,14 @@ RSpec.describe Mdm::SessionEvent, type: :model do
7
7
 
8
8
  context 'factory' do
9
9
  it 'should be valid' do
10
- session_event = FactoryGirl.build(:mdm_session_event)
10
+ session_event = FactoryBot.build(:mdm_session_event)
11
11
  expect(session_event).to be_valid
12
12
  end
13
13
  end
14
14
 
15
15
  context '#destroy' do
16
16
  it 'should successfully destroy the object' do
17
- session_event = FactoryGirl.create(:mdm_session_event)
17
+ session_event = FactoryBot.create(:mdm_session_event)
18
18
  expect {
19
19
  session_event.destroy
20
20
  }.to_not raise_error
@@ -39,4 +39,4 @@ RSpec.describe Mdm::SessionEvent, type: :model do
39
39
  end
40
40
  end
41
41
 
42
- end
42
+ end
@@ -3,14 +3,14 @@ RSpec.describe Mdm::Session, type: :model do
3
3
 
4
4
  context 'factory' do
5
5
  it 'should be valid' do
6
- session = FactoryGirl.build(:mdm_session)
6
+ session = FactoryBot.build(:mdm_session)
7
7
  expect(session).to be_valid
8
8
  end
9
9
  end
10
10
 
11
11
  context '#destroy' do
12
12
  it 'should successfully destroy the object' do
13
- session = FactoryGirl.create(:mdm_session)
13
+ session = FactoryBot.create(:mdm_session)
14
14
  expect {
15
15
  session.destroy
16
16
  }.to_not raise_error
@@ -56,8 +56,8 @@ RSpec.describe Mdm::Session, type: :model do
56
56
  context 'scopes' do
57
57
  context 'alive' do
58
58
  it 'should return sessions that have not been closed' do
59
- alive_session = FactoryGirl.create(:mdm_session)
60
- dead_session = FactoryGirl.create(:mdm_session, :closed_at => Time.now)
59
+ alive_session = FactoryBot.create(:mdm_session)
60
+ dead_session = FactoryBot.create(:mdm_session, :closed_at => Time.now)
61
61
  alive_set = Mdm::Session.alive
62
62
  expect(alive_set).to include(alive_session)
63
63
  expect(alive_set).not_to include(dead_session)
@@ -66,8 +66,8 @@ RSpec.describe Mdm::Session, type: :model do
66
66
 
67
67
  context 'dead' do
68
68
  it 'should return sessions that have been closed' do
69
- alive_session = FactoryGirl.create(:mdm_session)
70
- dead_session = FactoryGirl.create(:mdm_session, :closed_at => Time.now)
69
+ alive_session = FactoryBot.create(:mdm_session)
70
+ dead_session = FactoryBot.create(:mdm_session, :closed_at => Time.now)
71
71
  dead_set = Mdm::Session.dead
72
72
  expect(dead_set).not_to include(alive_session)
73
73
  expect(dead_set).to include(dead_session)
@@ -76,9 +76,9 @@ RSpec.describe Mdm::Session, type: :model do
76
76
 
77
77
  context 'upgradeable' do
78
78
  it 'should return sessions that can be upgraded to meterpreter' do
79
- win_shell = FactoryGirl.create(:mdm_session, :stype => 'shell', :platform => 'Windows')
80
- linux_shell = FactoryGirl.create(:mdm_session, :stype => 'shell', :platform => 'Linux')
81
- win_meterp = FactoryGirl.create(:mdm_session, :stype => 'meterpreter', :platform => 'Windows')
79
+ win_shell = FactoryBot.create(:mdm_session, :stype => 'shell', :platform => 'Windows')
80
+ linux_shell = FactoryBot.create(:mdm_session, :stype => 'shell', :platform => 'Linux')
81
+ win_meterp = FactoryBot.create(:mdm_session, :stype => 'meterpreter', :platform => 'Windows')
82
82
  upgrade_set = Mdm::Session.upgradeable
83
83
  expect(upgrade_set).to include(win_shell)
84
84
  expect(upgrade_set).not_to include(linux_shell)
@@ -90,7 +90,7 @@ RSpec.describe Mdm::Session, type: :model do
90
90
  context 'callbacks' do
91
91
  context 'before_destroy' do
92
92
  it 'should call #stop' do
93
- mysession = FactoryGirl.create(:mdm_session)
93
+ mysession = FactoryBot.create(:mdm_session)
94
94
  expect(mysession).to receive(:stop)
95
95
  mysession.destroy
96
96
  end
@@ -100,19 +100,19 @@ RSpec.describe Mdm::Session, type: :model do
100
100
  context 'methods' do
101
101
  context '#upgradeable?' do
102
102
  it 'should return true for windows shells' do
103
- win_shell = FactoryGirl.create(:mdm_session, :stype => 'shell', :platform => 'Windows')
103
+ win_shell = FactoryBot.create(:mdm_session, :stype => 'shell', :platform => 'Windows')
104
104
  expect(win_shell.upgradeable?).to eq(true)
105
105
  end
106
106
 
107
107
  it 'should return false for non-windows shells' do
108
- linux_shell = FactoryGirl.create(:mdm_session, :stype => 'shell', :platform => 'Linux')
108
+ linux_shell = FactoryBot.create(:mdm_session, :stype => 'shell', :platform => 'Linux')
109
109
  expect(linux_shell.upgradeable?).to eq(false)
110
110
  end
111
111
 
112
112
  it 'should return false for Windows Meterpreter Sessions' do
113
- win_meterp = FactoryGirl.create(:mdm_session, :stype => 'meterpreter', :platform => 'Windows')
113
+ win_meterp = FactoryBot.create(:mdm_session, :stype => 'meterpreter', :platform => 'Windows')
114
114
  expect(win_meterp.upgradeable?).to eq(false)
115
115
  end
116
116
  end
117
117
  end
118
- end
118
+ end
@@ -30,7 +30,7 @@ RSpec.describe Mdm::Tag, type: :model do
30
30
  context 'desc' do
31
31
  it 'should not ba valid for a length over 8k' do
32
32
  desc = SecureRandom.hex(9001) #over 9000?!
33
- large_tag = FactoryGirl.build(:mdm_tag, :desc => desc)
33
+ large_tag = FactoryBot.build(:mdm_tag, :desc => desc)
34
34
  expect(large_tag).not_to be_valid
35
35
  expect(large_tag.errors[:desc]).to include('desc must be less than 8k.')
36
36
  end
@@ -39,28 +39,28 @@ RSpec.describe Mdm::Tag, type: :model do
39
39
  context 'name' do
40
40
  let(:error_msg) {I18n.t('activerecord.ancestors.mdm/tag.model.errors.messages.character')}
41
41
  it 'must be present' do
42
- nameless_tag = FactoryGirl.build(:mdm_tag, :name => nil)
42
+ nameless_tag = FactoryBot.build(:mdm_tag, :name => nil)
43
43
  expect(nameless_tag).not_to be_valid
44
44
  expect(nameless_tag.errors[:name]).to include("can't be blank")
45
45
  end
46
46
 
47
47
  it 'may only contain alphanumerics, dot, dashes, and underscores' do
48
- mytag = FactoryGirl.build(:mdm_tag, :name => 'A.1-B_2')
48
+ mytag = FactoryBot.build(:mdm_tag, :name => 'A.1-B_2')
49
49
  expect(mytag).to be_valid
50
50
  #Test for various bad inputs we should never allow
51
- mytag = FactoryGirl.build(:mdm_tag, :name => "A'1")
51
+ mytag = FactoryBot.build(:mdm_tag, :name => "A'1")
52
52
  expect(mytag).not_to be_valid
53
53
  expect(mytag.errors[:name]).to include(error_msg)
54
- mytag = FactoryGirl.build(:mdm_tag, :name => "A;1")
54
+ mytag = FactoryBot.build(:mdm_tag, :name => "A;1")
55
55
  expect(mytag).not_to be_valid
56
56
  expect(mytag.errors[:name]).to include(error_msg)
57
- mytag = FactoryGirl.build(:mdm_tag, :name => "A%1")
57
+ mytag = FactoryBot.build(:mdm_tag, :name => "A%1")
58
58
  expect(mytag).not_to be_valid
59
59
  expect(mytag.errors[:name]).to include(error_msg)
60
- mytag = FactoryGirl.build(:mdm_tag, :name => "A=1")
60
+ mytag = FactoryBot.build(:mdm_tag, :name => "A=1")
61
61
  expect(mytag).not_to be_valid
62
62
  expect(mytag.errors[:name]).to include(error_msg)
63
- mytag = FactoryGirl.build(:mdm_tag, :name => "#A1")
63
+ mytag = FactoryBot.build(:mdm_tag, :name => "#A1")
64
64
  expect(mytag).not_to be_valid
65
65
  expect(mytag.errors[:name]).to include(error_msg)
66
66
  end
@@ -70,7 +70,7 @@ RSpec.describe Mdm::Tag, type: :model do
70
70
  context 'instance methods' do
71
71
  context '#to_s' do
72
72
  it 'should return the name of the tag as a string' do
73
- mytag = FactoryGirl.build(:mdm_tag, :name => 'mytag')
73
+ mytag = FactoryBot.build(:mdm_tag, :name => 'mytag')
74
74
  expect(mytag.to_s).to eq('mytag')
75
75
  end
76
76
  end
@@ -79,7 +79,7 @@ RSpec.describe Mdm::Tag, type: :model do
79
79
  context 'factories' do
80
80
  context 'mdm_tag' do
81
81
  subject(:mdm_tag) do
82
- FactoryGirl.build(:mdm_tag)
82
+ FactoryBot.build(:mdm_tag)
83
83
  end
84
84
 
85
85
  it { is_expected.to be_valid }
@@ -88,7 +88,7 @@ RSpec.describe Mdm::Tag, type: :model do
88
88
 
89
89
  context '#destroy' do
90
90
  let!(:tag) do
91
- FactoryGirl.create(:mdm_tag)
91
+ FactoryBot.create(:mdm_tag)
92
92
  end
93
93
 
94
94
  it 'should successfully destroy the object' do
@@ -113,4 +113,4 @@ RSpec.describe Mdm::Tag, type: :model do
113
113
  type: :string
114
114
  end
115
115
  end
116
- end
116
+ end
@@ -3,7 +3,7 @@ RSpec.describe Mdm::TaskCred, type: :model do
3
3
 
4
4
  context 'factory' do
5
5
  it 'should be valid' do
6
- task_cred = FactoryGirl.build(:mdm_task_cred)
6
+ task_cred = FactoryBot.build(:mdm_task_cred)
7
7
  expect(task_cred).to be_valid
8
8
  end
9
9
  end
@@ -23,7 +23,7 @@ RSpec.describe Mdm::TaskCred, type: :model do
23
23
 
24
24
  context '#destroy' do
25
25
  it 'should successfully destroy the object' do
26
- task_cred = FactoryGirl.create(:mdm_task_cred)
26
+ task_cred = FactoryBot.create(:mdm_task_cred)
27
27
  expect {
28
28
  task_cred.destroy
29
29
  }.to_not raise_error
@@ -40,10 +40,10 @@ RSpec.describe Mdm::TaskCred, type: :model do
40
40
 
41
41
  context "validations" do
42
42
  it "should not allow duplicate associations" do
43
- task = FactoryGirl.build(:mdm_task)
44
- cred = FactoryGirl.build(:mdm_cred)
45
- FactoryGirl.create(:mdm_task_cred, :task => task, :cred => cred)
46
- task_cred2 = FactoryGirl.build(:mdm_task_cred, :task => task, :cred => cred)
43
+ task = FactoryBot.build(:mdm_task)
44
+ cred = FactoryBot.build(:mdm_cred)
45
+ FactoryBot.create(:mdm_task_cred, :task => task, :cred => cred)
46
+ task_cred2 = FactoryBot.build(:mdm_task_cred, :task => task, :cred => cred)
47
47
  expect(task_cred2).not_to be_valid
48
48
  end
49
49
  end
@@ -3,7 +3,7 @@ RSpec.describe Mdm::TaskHost, type: :model do
3
3
 
4
4
  context 'factory' do
5
5
  it 'should be valid' do
6
- task_host = FactoryGirl.build(:mdm_task_host)
6
+ task_host = FactoryBot.build(:mdm_task_host)
7
7
  expect(task_host).to be_valid
8
8
  end
9
9
  end
@@ -23,7 +23,7 @@ RSpec.describe Mdm::TaskHost, type: :model do
23
23
 
24
24
  context '#destroy' do
25
25
  it 'should successfully destroy the object' do
26
- task_host = FactoryGirl.create(:mdm_task_host)
26
+ task_host = FactoryBot.create(:mdm_task_host)
27
27
  expect {
28
28
  task_host.destroy
29
29
  }.to_not raise_error
@@ -40,10 +40,10 @@ RSpec.describe Mdm::TaskHost, type: :model do
40
40
 
41
41
  context "validations" do
42
42
  it "should not allow duplicate associations" do
43
- task = FactoryGirl.build(:mdm_task)
44
- host = FactoryGirl.build(:mdm_host)
45
- FactoryGirl.create(:mdm_task_host, :task => task, :host => host)
46
- task_host2 = FactoryGirl.build(:mdm_task_host, :task => task, :host => host)
43
+ task = FactoryBot.build(:mdm_task)
44
+ host = FactoryBot.build(:mdm_host)
45
+ FactoryBot.create(:mdm_task_host, :task => task, :host => host)
46
+ task_host2 = FactoryBot.build(:mdm_task_host, :task => task, :host => host)
47
47
  expect(task_host2).not_to be_valid
48
48
  end
49
49
  end
@@ -3,7 +3,7 @@ RSpec.describe Mdm::TaskService, type: :model do
3
3
 
4
4
  context 'factory' do
5
5
  it 'should be valid' do
6
- task_service = FactoryGirl.build(:mdm_task_service)
6
+ task_service = FactoryBot.build(:mdm_task_service)
7
7
  expect(task_service).to be_valid
8
8
  end
9
9
  end
@@ -23,7 +23,7 @@ RSpec.describe Mdm::TaskService, type: :model do
23
23
 
24
24
  context '#destroy' do
25
25
  it 'should successfully destroy the object' do
26
- task_service = FactoryGirl.create(:mdm_task_service)
26
+ task_service = FactoryBot.create(:mdm_task_service)
27
27
  expect {
28
28
  task_service.destroy
29
29
  }.to_not raise_error
@@ -40,10 +40,10 @@ RSpec.describe Mdm::TaskService, type: :model do
40
40
 
41
41
  context "validations" do
42
42
  it "should not allow duplicate associations" do
43
- task = FactoryGirl.build(:mdm_task)
44
- service = FactoryGirl.build(:mdm_service)
45
- FactoryGirl.create(:mdm_task_service, :task => task, :service => service)
46
- task_service2 = FactoryGirl.build(:mdm_task_service, :task => task, :service => service)
43
+ task = FactoryBot.build(:mdm_task)
44
+ service = FactoryBot.build(:mdm_service)
45
+ FactoryBot.create(:mdm_task_service, :task => task, :service => service)
46
+ task_service2 = FactoryBot.build(:mdm_task_service, :task => task, :service => service)
47
47
  expect(task_service2).not_to be_valid
48
48
  end
49
49
  end
@@ -3,7 +3,7 @@ RSpec.describe Mdm::TaskSession, type: :model do
3
3
 
4
4
  context 'factory' do
5
5
  it 'should be valid' do
6
- task_session = FactoryGirl.build(:mdm_task_session)
6
+ task_session = FactoryBot.build(:mdm_task_session)
7
7
  expect(task_session).to be_valid
8
8
  end
9
9
  end
@@ -23,7 +23,7 @@ RSpec.describe Mdm::TaskSession, type: :model do
23
23
 
24
24
  context '#destroy' do
25
25
  it 'should successfully destroy the object' do
26
- task_session = FactoryGirl.create(:mdm_task_session)
26
+ task_session = FactoryBot.create(:mdm_task_session)
27
27
  expect {
28
28
  task_session.destroy
29
29
  }.to_not raise_error
@@ -35,10 +35,10 @@ RSpec.describe Mdm::TaskSession, type: :model do
35
35
 
36
36
  context "validations" do
37
37
  it "should not allow duplicate associations" do
38
- task = FactoryGirl.build(:mdm_task)
39
- session = FactoryGirl.build(:mdm_session)
40
- FactoryGirl.create(:mdm_task_session, :task => task, :session => session)
41
- task_session2 = FactoryGirl.build(:mdm_task_session, :task => task, :session => session)
38
+ task = FactoryBot.build(:mdm_task)
39
+ session = FactoryBot.build(:mdm_session)
40
+ FactoryBot.create(:mdm_task_session, :task => task, :session => session)
41
+ task_session2 = FactoryBot.build(:mdm_task_session, :task => task, :session => session)
42
42
  expect(task_session2).not_to be_valid
43
43
  end
44
44
  end
@@ -3,7 +3,7 @@ RSpec.describe Mdm::Task, type: :model do
3
3
 
4
4
  context 'factory' do
5
5
  it 'should be valid' do
6
- task = FactoryGirl.build(:mdm_task)
6
+ task = FactoryBot.build(:mdm_task)
7
7
  expect(task).to be_valid
8
8
  end
9
9
  end
@@ -34,7 +34,7 @@ RSpec.describe Mdm::Task, type: :model do
34
34
 
35
35
  context '#destroy' do
36
36
  it 'should successfully destroy the object' do
37
- task = FactoryGirl.create(:mdm_task)
37
+ task = FactoryBot.create(:mdm_task)
38
38
  expect {
39
39
  task.destroy
40
40
  }.to_not raise_error
@@ -60,7 +60,7 @@ RSpec.describe Mdm::Task, type: :model do
60
60
  context 'callbacks' do
61
61
  context 'before_destroy' do
62
62
  it 'should call #delete_file' do
63
- task = FactoryGirl.create(:mdm_task)
63
+ task = FactoryBot.create(:mdm_task)
64
64
  expect(task).to receive(:delete_file)
65
65
  task.destroy
66
66
  end
@@ -30,14 +30,14 @@ RSpec.describe Mdm::User, type: :model do
30
30
 
31
31
  context 'factory' do
32
32
  it 'should be valid' do
33
- user = FactoryGirl.build(:mdm_user)
33
+ user = FactoryBot.build(:mdm_user)
34
34
  expect(user).to be_valid
35
35
  end
36
36
  end
37
37
 
38
38
  context '#destroy' do
39
39
  it 'should successfully destroy the object' do
40
- user = FactoryGirl.create(:mdm_user)
40
+ user = FactoryBot.create(:mdm_user)
41
41
  expect {
42
42
  user.destroy
43
43
  }.to_not raise_error
@@ -47,4 +47,4 @@ RSpec.describe Mdm::User, type: :model do
47
47
  end
48
48
  end
49
49
 
50
- end
50
+ end
@@ -25,7 +25,7 @@ RSpec.describe Mdm::VulnAttempt, type: :model do
25
25
 
26
26
  context 'validations' do
27
27
  it 'should require a vuln_id' do
28
- orphan_detail = FactoryGirl.build(:mdm_vuln_detail, :vuln => nil)
28
+ orphan_detail = FactoryBot.build(:mdm_vuln_detail, :vuln => nil)
29
29
  expect(orphan_detail).not_to be_valid
30
30
  expect(orphan_detail.errors[:vuln_id]).to include("can't be blank")
31
31
  end
@@ -33,14 +33,14 @@ RSpec.describe Mdm::VulnAttempt, type: :model do
33
33
 
34
34
  context 'factory' do
35
35
  it 'should be valid' do
36
- vuln_attempt = FactoryGirl.build(:mdm_vuln_attempt)
36
+ vuln_attempt = FactoryBot.build(:mdm_vuln_attempt)
37
37
  expect(vuln_attempt).to be_valid
38
38
  end
39
39
  end
40
40
 
41
41
  context '#destroy' do
42
42
  it 'should successfully destroy the object' do
43
- vuln_attempt = FactoryGirl.create(:mdm_vuln_attempt)
43
+ vuln_attempt = FactoryBot.create(:mdm_vuln_attempt)
44
44
  expect {
45
45
  vuln_attempt.destroy
46
46
  }.to_not raise_error
@@ -50,4 +50,4 @@ RSpec.describe Mdm::VulnAttempt, type: :model do
50
50
  end
51
51
  end
52
52
 
53
- end
53
+ end
@@ -37,7 +37,7 @@ RSpec.describe Mdm::VulnDetail, type: :model do
37
37
 
38
38
  context 'validations' do
39
39
  it 'should require a vuln_id' do
40
- orphan_detail = FactoryGirl.build(:mdm_vuln_detail, :vuln => nil)
40
+ orphan_detail = FactoryBot.build(:mdm_vuln_detail, :vuln => nil)
41
41
  expect(orphan_detail).not_to be_valid
42
42
  expect(orphan_detail.errors[:vuln_id]).to include("can't be blank")
43
43
  end
@@ -45,14 +45,14 @@ RSpec.describe Mdm::VulnDetail, type: :model do
45
45
 
46
46
  context 'factory' do
47
47
  it 'should be valid' do
48
- vuln_detail = FactoryGirl.build(:mdm_vuln_detail)
48
+ vuln_detail = FactoryBot.build(:mdm_vuln_detail)
49
49
  expect(vuln_detail).to be_valid
50
50
  end
51
51
  end
52
52
 
53
53
  context '#destroy' do
54
54
  it 'should successfully destroy the object' do
55
- vuln_detail = FactoryGirl.create(:mdm_vuln_detail)
55
+ vuln_detail = FactoryBot.create(:mdm_vuln_detail)
56
56
  expect {
57
57
  vuln_detail.destroy
58
58
  }.to_not raise_error
@@ -4,7 +4,7 @@ RSpec.describe Mdm::VulnRef, type: :model do
4
4
  context 'factories' do
5
5
  context 'mdm_vuln_ref' do
6
6
  subject(:mdm_vuln_ref) do
7
- FactoryGirl.build(:mdm_vuln_ref)
7
+ FactoryBot.build(:mdm_vuln_ref)
8
8
  end
9
9
 
10
10
  it { is_expected.to be_valid }
@@ -26,14 +26,14 @@ RSpec.describe Mdm::VulnRef, type: :model do
26
26
 
27
27
  context 'factory' do
28
28
  it 'should be valid' do
29
- vuln_ref = FactoryGirl.build(:mdm_vuln_ref)
29
+ vuln_ref = FactoryBot.build(:mdm_vuln_ref)
30
30
  expect(vuln_ref).to be_valid
31
31
  end
32
32
  end
33
33
 
34
34
  context '#destroy' do
35
35
  it 'should successfully destroy the object' do
36
- vuln_ref = FactoryGirl.create(:mdm_vuln_ref)
36
+ vuln_ref = FactoryBot.create(:mdm_vuln_ref)
37
37
  expect {
38
38
  vuln_ref.destroy
39
39
  }.to_not raise_error
@@ -43,4 +43,4 @@ RSpec.describe Mdm::VulnRef, type: :model do
43
43
  end
44
44
  end
45
45
 
46
- end
46
+ end