Sha256: 09e5b73762cba96ab354ace842778abc8ac0b84035f630742aefd99f50a044b6
Contents?: true
Size: 760 Bytes
Versions: 10
Compression:
Stored size: 760 Bytes
Contents
require 'spec_helper' describe CMSScanner::RobotsTxt do subject(:file) { described_class.new(url) } let(:url) { 'http://example.com/robots.txt' } let(:fixtures) { File.join(FIXTURES, 'interesting_files', 'robots_txt') } describe '#interesting_entries' do let(:headers) { { 'Content-Type' => 'text/plain; charset=utf-8' } } after do body = File.new(File.join(fixtures, fixture)).read stub_request(:get, file.url).to_return(headers: headers, body: body) expect(file.interesting_entries).to eq @expected end context 'when empty or / entries' do let(:fixture) { 'robots.txt' } it 'ignores them and only returns the others' do @expected = %w(/admin /public/home) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems