This commit is contained in:
erwanlr
2020-10-28 10:10:57 +01:00
parent c4030d8267
commit 611d3dfd4d
4 changed files with 20 additions and 4 deletions

View File

@@ -238,7 +238,19 @@ shared_examples WPScan::Target::Platform::WordPress do
end
describe '#login_url' do
before { allow(target).to receive(:sub_dir) }
before do
allow(target).to receive(:sub_dir)
WPScan::ParsedCli.options = rspec_parsed_options(cli_args)
end
let(:cli_args) { '--url https://ex.lo' }
context 'when login_uri CLI option set' do
let(:cli_args) { "#{super()} --login_uri other-login.php" }
its(:login_url) { should eql target.url('other-login.php') }
end
context 'when returning a 200' do
before { stub_request(:get, target.url('wp-login.php')).to_return(status: 200) }