Sha256: 8d7120c8b76844ad3ec953a9ae94cc440c4b55032f386cc4c66c0d3c40b520af

Contents?: true

Size: 1.71 KB

Versions: 10

Compression:

Stored size: 1.71 KB

Contents

require 'spec_helper'

describe name_from_filename do
    include_examples 'plugin'

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

    context 'when given the right params' do
        it 'locates the form and login successfully' do
            options.plugins[component_name] = {
                'username_field' => 'username',
                'password_field' => 'password',
                'username_list'  => fixtures_path + 'usernames.txt',
                'password_list'  => fixtures_path + 'passwords.txt',
                'login_verifier' => 'logged in user!'
            }

            run
            actual_results.should == { 'username' => 'sys', 'password' => 'admin' }
        end
    end

    context 'when being unable to login' do
        it 'logs nothing' do
            options.plugins[component_name] = {
                'username_field' => 'username',
                'password_field' => 'password',
                'username_list'  => fixtures_path + 'usernames.txt',
                'password_list'  => fixtures_path + 'passwords.txt',
                'login_verifier' => '34342#R#@$#2'
            }

            run
            actual_results.should be_nil
        end
    end

    context 'when given invalid params' do
        it 'complains about not being able to find the form' do
            options.plugins[component_name] = {
                'username_field' => 'username2',
                'password_field' => 'password',
                'username_list'  => fixtures_path + 'usernames.txt',
                'password_list'  => fixtures_path + 'passwords.txt',
                'login_verifier' => 'logged in user!'
            }

            run
            actual_results.should be_nil
        end
    end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
arachni-1.2.1 spec/components/plugins/form_dicattack_spec.rb
arachni-1.2 spec/components/plugins/form_dicattack_spec.rb
arachni-1.1 spec/components/plugins/form_dicattack_spec.rb
arachni-1.0.6 spec/components/plugins/form_dicattack_spec.rb
arachni-1.0.5 spec/components/plugins/form_dicattack_spec.rb
arachni-1.0.4 spec/components/plugins/form_dicattack_spec.rb
arachni-1.0.3 spec/components/plugins/form_dicattack_spec.rb
arachni-1.0.2 spec/components/plugins/form_dicattack_spec.rb
arachni-1.0.1 spec/components/plugins/form_dicattack_spec.rb
arachni-1.0 spec/components/plugins/form_dicattack_spec.rb