Path: blob/master/spec/shared_examples/views/enumeration/medias.rb
485 views
# frozen_string_literal: true12shared_examples 'App::Views::Enumeration::Medias' do3let(:view) { 'medias' }4let(:media) { WPScan::Model::Media }56describe 'medias' do7context 'when no medias found' do8let(:expected_view) { File.join(view, 'none_found') }910it 'outputs the expected string' do11@tpl_vars = tpl_vars.merge(medias: [])12end13end1415context 'when medias found' do16let(:m1) { media.new("#{target_url}?attachment_id=1", found_by: 'Attachment Brute Forcing') }17let(:m2) { media.new("#{target_url}?attachment_id=5", found_by: 'Attachment Brute Forcing') }18let(:medias) { [m1, m2] }19let(:expected_view) { File.join(view, 'medias') }2021it 'outputs the expected string' do22@tpl_vars = tpl_vars.merge(medias: medias)23end24end25end26end272829