Moves Models into their own namespace - Ref #1315

This commit is contained in:
erwanlr
2019-03-19 21:07:53 +00:00
parent f1657164d5
commit 898e8d4546
116 changed files with 613 additions and 560 deletions

View File

@@ -1,6 +1,6 @@
shared_examples 'App::Views::Enumeration::ConfigBackups' do
let(:view) { 'config_backups' }
let(:config_backup) { WPScan::ConfigBackup }
let(:config_backup) { WPScan::Model::ConfigBackup }
describe 'config_backups' do
context 'when no backups found' do

View File

@@ -1,6 +1,6 @@
shared_examples 'App::Views::Enumeration::DbExports' do
let(:view) { 'db_exports' }
let(:db_export) { WPScan::DbExport }
let(:db_export) { WPScan::Model::DbExport }
describe 'db_exports' do
context 'when no file found' do

View File

@@ -1,6 +1,6 @@
shared_examples 'App::Views::Enumeration::Medias' do
let(:view) { 'medias' }
let(:media) { WPScan::Media }
let(:media) { WPScan::Model::Media }
describe 'medias' do
context 'when no medias found' do

View File

@@ -1,6 +1,6 @@
shared_examples 'App::Views::Enumeration::Plugins' do
let(:view) { 'plugins' }
let(:plugin) { WPScan::Plugin }
let(:plugin) { WPScan::Model::Plugin }
describe 'plugins' do
context 'when no plugins found' do

View File

@@ -1,6 +1,6 @@
shared_examples 'App::Views::Enumeration::Themes' do
let(:view) { 'themes' }
let(:plugin) { WPScan::Theme }
let(:plugin) { WPScan::Model::Theme }
describe 'themes' do
context 'when no themes found' do

View File

@@ -1,7 +1,7 @@
shared_examples 'App::Views::Enumeration::Timthumbs' do
let(:view) { 'timthumbs' }
let(:timthumb) { WPScan::Timthumb }
let(:version) { WPScan::Version.new('2.8.14', found_by: 'Bad Request') }
let(:timthumb) { WPScan::Model::Timthumb }
let(:version) { WPScan::Model::Version.new('2.8.14', found_by: 'Bad Request') }
describe 'timthumbs' do
context 'when no timthumbs found' do

View File

@@ -1,6 +1,6 @@
shared_examples 'App::Views::Enumeration::Users' do
let(:view) { 'users' }
let(:user) { CMSScanner::User }
let(:user) { WPScan::Model::User }
describe 'users' do
context 'when no users found' do

View File

@@ -1,7 +1,7 @@
shared_examples 'App::Views::MainTheme' do
let(:controller) { WPScan::Controller::MainTheme.new }
let(:tpl_vars) { { url: target_url } }
let(:theme) { WPScan::Theme.new(theme_name, target, found_by: 'rspec') }
let(:theme) { WPScan::Model::Theme.new(theme_name, target, found_by: 'rspec') }
describe 'main_theme' do
let(:view) { 'theme' }
@@ -38,7 +38,11 @@ shared_examples 'App::Views::MainTheme' do
let(:expected_view) { 'verbose' }
it 'outputs the expected string' do
expect(theme).to receive(:version).at_least(1).and_return(WPScan::Version.new('3.2', found_by: 'style'))
expect(theme)
.to receive(:version)
.at_least(1)
.and_return(WPScan::Model::Version.new('3.2', found_by: 'style'))
@tpl_vars = tpl_vars.merge(theme: theme, verbose: true)
end
end

View File

@@ -14,7 +14,7 @@ shared_examples 'App::Views::WpVersion' do
end
context 'when the version is not nil' do
let(:version) { WPScan::WpVersion.new('4.0', found_by: 'rspec') }
let(:version) { WPScan::Model::WpVersion.new('4.0', found_by: 'rspec') }
context 'when confirmed_by is empty' do
context 'when no interesting_entries' do
@@ -77,7 +77,7 @@ shared_examples 'App::Views::WpVersion' do
let(:expected_view) { 'with_vulns' }
it 'outputs the expected string' do
@tpl_vars = tpl_vars.merge(version: WPScan::WpVersion.new('3.8.1', found_by: 'rspec'))
@tpl_vars = tpl_vars.merge(version: WPScan::Model::WpVersion.new('3.8.1', found_by: 'rspec'))
end
end
end