CR: remove ARE rules related tests

This commit is contained in:
Jake Webster
2026-02-02 11:07:36 +10:00
parent 68d19a3221
commit f238e20a51
3 changed files with 0 additions and 94 deletions

View File

@@ -41,7 +41,6 @@ RSpec.describe BeEF::Core::Handlers::BrowserDetails do
else else
stub_const('BeEF::Core::Models::NetworkHost', double('NetworkHost', create: nil)) stub_const('BeEF::Core::Models::NetworkHost', double('NetworkHost', create: nil))
end end
allow(BeEF::Core::AutorunEngine::Engine.instance).to receive(:find_and_run_all_matching_rules_for_zombie)
end end
describe '#initialize' do describe '#initialize' do

View File

@@ -1,37 +0,0 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::Models::Execution do
describe '.create' do
let(:rule) do
BeEF::Core::Models::Rule.create!(
name: 'test_rule',
author: 'test',
browser: 'FF',
browser_version: '1.0',
os: 'Windows',
os_version: '10',
modules: [].to_json,
execution_order: '1',
execution_delay: '0',
chain_mode: 'sequential'
)
end
it 'creates an execution with a rule_id' do
execution = described_class.create!(rule_id: rule.id)
expect(execution).to be_persisted
expect(execution.rule_id).to eq(rule.id)
end
it 'can access rule_id' do
execution = described_class.create!(rule_id: rule.id)
expect(execution.rule_id).to eq(rule.id)
end
end
end

View File

@@ -1,56 +0,0 @@
#
# Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - https://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
RSpec.describe BeEF::Core::Models::Rule do
describe 'associations' do
it 'has_many executions' do
expect(described_class.reflect_on_association(:executions)).not_to be_nil
expect(described_class.reflect_on_association(:executions).macro).to eq(:has_many)
end
end
describe '.create' do
it 'creates a rule with required attributes' do
rule = described_class.create!(
name: 'test_rule',
author: 'test_author',
browser: 'FF',
browser_version: '1.0',
os: 'Windows',
os_version: '10',
modules: [].to_json,
execution_order: '1',
execution_delay: '0',
chain_mode: 'sequential'
)
expect(rule).to be_persisted
expect(rule.name).to eq('test_rule')
expect(rule.chain_mode).to eq('sequential')
end
it 'can have multiple executions' do
rule = described_class.create!(
name: 'test_rule',
author: 'test',
browser: 'FF',
browser_version: '1.0',
os: 'Windows',
os_version: '10',
modules: [].to_json,
execution_order: '1',
execution_delay: '0',
chain_mode: 'sequential'
)
execution1 = BeEF::Core::Models::Execution.create!(rule_id: rule.id)
execution2 = BeEF::Core::Models::Execution.create!(rule_id: rule.id)
expect(rule.executions.count).to eq(2)
expect(rule.executions).to include(execution1, execution2)
end
end
end