Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wpscanteam
GitHub Repository: wpscanteam/wpscan
Path: blob/master/spec/shared_examples/views/enumeration/medias.rb
485 views
1
# frozen_string_literal: true
2
3
shared_examples 'App::Views::Enumeration::Medias' do
4
let(:view) { 'medias' }
5
let(:media) { WPScan::Model::Media }
6
7
describe 'medias' do
8
context 'when no medias found' do
9
let(:expected_view) { File.join(view, 'none_found') }
10
11
it 'outputs the expected string' do
12
@tpl_vars = tpl_vars.merge(medias: [])
13
end
14
end
15
16
context 'when medias found' do
17
let(:m1) { media.new("#{target_url}?attachment_id=1", found_by: 'Attachment Brute Forcing') }
18
let(:m2) { media.new("#{target_url}?attachment_id=5", found_by: 'Attachment Brute Forcing') }
19
let(:medias) { [m1, m2] }
20
let(:expected_view) { File.join(view, 'medias') }
21
22
it 'outputs the expected string' do
23
@tpl_vars = tpl_vars.merge(medias: medias)
24
end
25
end
26
end
27
end
28
29