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

Version Path
cms_scanner-0.0.16 spec/app/models/robots_txt_spec.rb
cms_scanner-0.0.15 spec/app/models/robots_txt_spec.rb
cms_scanner-0.0.14 spec/app/models/robots_txt_spec.rb
cms_scanner-0.0.13 spec/app/models/robots_txt_spec.rb
cms_scanner-0.0.12 spec/app/models/robots_txt_spec.rb
cms_scanner-0.0.11 spec/app/models/robots_txt_spec.rb
cms_scanner-0.0.10 spec/app/models/robots_txt_spec.rb
cms_scanner-0.0.9 spec/app/models/robots_txt_spec.rb
cms_scanner-0.0.8 spec/app/models/robots_txt_spec.rb
cms_scanner-0.0.7 spec/app/models/robots_txt_spec.rb