Path: blob/master/spec/app/finders/plugins/urls_in_homepage_spec.rb
2306 views
# frozen_string_literal: true12describe WPScan::Finders::Plugins::UrlsInHomepage do3subject(:finder) { described_class.new(target) }4let(:target) { WPScan::Target.new(url) }5let(:url) { 'https://wp.lab/' }6let(:fixtures) { FINDERS_FIXTURES.join('plugins', 'urls_in_homepage') }78before { target.scope << 'sub.lab' }910it_behaves_like 'App::Finders::WpItems::UrlsInPage' do11let(:page_url) { url }12let(:type) { 'plugins' }13let(:uniq_links) { true }14let(:uniq_codes) { true }15let(:expected_from_links) { (1..5).map { |i| "dl-#{i}" } }16let(:expected_from_codes) { (1..6).map { |i| "dc-#{i}" } }17end1819describe '#passive' do20before do21stub_request(:get, finder.target.url)22.to_return(body: File.read(fixtures.join('found.html')))2324expect(finder.target).to receive(:content_dir).at_least(1).and_return('wp-content')25end2627xit28end29end303132