Path: blob/master/spec/app/controllers/aliases_spec.rb
486 views
# frozen_string_literal: true12describe WPScan::Controller::Aliases do3subject(:controller) { described_class.new }4let(:target_url) { 'http://ex.lo/' }5let(:cli_args) { "--url #{target_url}" }67before do8WPScan::ParsedCli.options = rspec_parsed_options(cli_args)9end1011describe '#cli_options' do12its(:cli_options) { should_not be_empty }13its(:cli_options) { should be_a Array }1415it 'contains to correct options' do16expect(controller.cli_options.map(&:to_sym)).to eq %i[stealthy]17end18end1920describe 'parsed_options' do21context 'when no --stealthy supplied' do22it 'contains the correct options' do23expect(WPScan::ParsedCli.options).to include(24detection_mode: :mixed, plugins_version_detection: :mixed25)26end27end2829context 'when --stealthy supplied' do30let(:cli_args) { "#{super()} --stealthy" }3132it 'contains the correct options' do33expect(WPScan::ParsedCli.options).to include(34random_user_agent: true, detection_mode: :passive, plugins_version_detection: :passive35)36end37end38end39end404142