Sha256: 08a3df16ea5ed3a952175a24ac46ef6c8c2575c7fe784e88c820648a35d05812

Contents?: true

Size: 1.21 KB

Versions: 9

Compression:

Stored size: 1.21 KB

Contents

require 'spec_helper'

describe name_from_filename do
    include_examples 'plugin'

    def url
        web_server_url_for( name_from_filename ) + '/'
    end

    context 'when malicious requests are' do
        context 'being rejected' do
            it 'logs that a WAF exists' do
                options.url = "#{url}positive"
                run
                results_for( name_from_filename ).should == {
                    code: 1, msg: framework.plugins[name_from_filename]::MSG_FOUND
                }
            end
        end

        context 'being accepted' do
            it 'does log a WAF' do
                options.url = "#{url}negative"
                run
                results_for( name_from_filename ).should == {
                    code: 0, msg: framework.plugins[name_from_filename]::MSG_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
            results_for( name_from_filename ).should == {
                code: -1, msg: framework.plugins[name_from_filename]::MSG_INCONCLUSIVE
            }
        end
    end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
arachni-0.4.7 spec/plugins/waf_detector_spec.rb
arachni-0.4.6 spec/plugins/waf_detector_spec.rb
arachni-0.4.5.2 spec/plugins/waf_detector_spec.rb
arachni-0.4.5.1 spec/plugins/waf_detector_spec.rb
arachni-0.4.5 spec/plugins/waf_detector_spec.rb
arachni-0.4.4 spec/plugins/waf_detector_spec.rb
arachni-0.4.3.2 spec/plugins/waf_detector_spec.rb
arachni-0.4.3.1 spec/plugins/waf_detector_spec.rb
arachni-0.4.3 spec/plugins/waf_detector_spec.rb