Sha256: df788941bf482b4ad198a848b0847c4230527353334612be27a265d6a217d51a

Contents?: true

Size: 1.17 KB

Versions: 11

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

describe name_from_filename do
    include_examples 'plugin'

    before( :all ) do
        options.url = url
    end

    it 'logs the expected results' do
        run

        expect(actual_results.size).to eq(3)

        oks = 0
        actual_results.each do |result|
            if (result['response']['url'] == url &&
                result['cookies'] == { 'cookie1' => 'val1' }) ||
                (result['response']['url'] == url + 'a_link' &&
                result['cookies'] == { 'link_followed' => 'yay link!' }) ||
                (result['response']['url'] == url + 'update_cookie' &&
                result['cookies'] == { 'link_followed' => 'updated link!', 'stuff' => 'blah' })
                oks += 1
            end
        end

        expect(oks).to eq(3)
    end

    context 'when a filter has been specified' do
        it 'only logs cookies that match it' do
            options.plugins[component_name] = { 'filter' => 'followed' }

            run

            expect(actual_results.size).to eq(2)
            expect(actual_results.map { |r| r['cookies'].keys }.flatten.
                uniq.sort).to eq(%w(link_followed))
        end
    end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
arachni-1.6.1.3 spec/components/plugins/cookie_collector_spec.rb
arachni-1.6.1.2 spec/components/plugins/cookie_collector_spec.rb
arachni-1.6.1.1 spec/components/plugins/cookie_collector_spec.rb
arachni-1.6.1 spec/components/plugins/cookie_collector_spec.rb
arachni-1.6.0 spec/components/plugins/cookie_collector_spec.rb
arachni-1.5.1 spec/components/plugins/cookie_collector_spec.rb
arachni-1.5 spec/components/plugins/cookie_collector_spec.rb
arachni-1.4 spec/components/plugins/cookie_collector_spec.rb
arachni-1.3.2 spec/components/plugins/cookie_collector_spec.rb
arachni-1.3.1 spec/components/plugins/cookie_collector_spec.rb
arachni-1.3 spec/components/plugins/cookie_collector_spec.rb