Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wpscanteam
GitHub Repository: wpscanteam/wpscan
Path: blob/master/spec/app/finders/plugins/urls_in_homepage_spec.rb
2306 views
1
# frozen_string_literal: true
2
3
describe WPScan::Finders::Plugins::UrlsInHomepage do
4
subject(:finder) { described_class.new(target) }
5
let(:target) { WPScan::Target.new(url) }
6
let(:url) { 'https://wp.lab/' }
7
let(:fixtures) { FINDERS_FIXTURES.join('plugins', 'urls_in_homepage') }
8
9
before { target.scope << 'sub.lab' }
10
11
it_behaves_like 'App::Finders::WpItems::UrlsInPage' do
12
let(:page_url) { url }
13
let(:type) { 'plugins' }
14
let(:uniq_links) { true }
15
let(:uniq_codes) { true }
16
let(:expected_from_links) { (1..5).map { |i| "dl-#{i}" } }
17
let(:expected_from_codes) { (1..6).map { |i| "dc-#{i}" } }
18
end
19
20
describe '#passive' do
21
before do
22
stub_request(:get, finder.target.url)
23
.to_return(body: File.read(fixtures.join('found.html')))
24
25
expect(finder.target).to receive(:content_dir).at_least(1).and_return('wp-content')
26
end
27
28
xit
29
end
30
end
31
32