Sha256: ea24117038d1790d2d8ac4dd6922ce8fa6d0ed8eaa92798ad548539808208790

Contents?: true

Size: 871 Bytes

Versions: 10

Compression:

Stored size: 871 Bytes

Contents

require 'spec_helper'

describe CMSScanner::FantasticoFileslist do
  subject(:file) { described_class.new(url) }
  let(:url)      { 'http://example.com/robots.txt' }
  let(:fixtures) { File.join(FIXTURES, 'interesting_files', 'fantastico_fileslist') }

  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) { 'fantastico_fileslist.txt' }

      it 'ignores them and only returns the others' do
        @expected = %w(data.sql admin.txt)
      end
    end
  end

  describe '#references' do
    its(:references) { should_not be_nil }
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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