Sha256: 2e67c311df1f200a43e16893dcea9acd2d19563ac4029c63101957f50758219d

Contents?: true

Size: 1.26 KB

Versions: 11

Compression:

Stored size: 1.26 KB

Contents

require 'spec_helper'

describe name_from_filename do
    include_examples 'plugin'

    def url
        Arachni::Utilities.normalize_url web_server_url_for( component_name )
    end

    context 'when malicious requests are' do
        context 'being rejected' do
            it 'logs that a WAF exists' do
                options.url = "#{url}positive"

                run

                expect(actual_results).to eq({
                    'status'  => 'found',
                    'message' => plugin::STATUSES[:found]
                })
            end
        end

        context 'being accepted' do
            it 'does not log a WAF' do
                options.url = "#{url}negative"

                run

                expect(actual_results).to eq({
                    'status'  => 'not_found',
                    'message' => plugin::STATUSES[:not_found]
                })
            end
        end
    end

    context 'when the webapp behaves erratically' do
        it 'logs that the tests were inconclusive' do
            options.url = "#{url}inconclusive"

            run

            expect(actual_results).to eq({
                'status'  => 'inconclusive',
                'message' => plugin::STATUSES[:inconclusive]
            })
        end
    end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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