Sha256: 7984f5c467dae36e3b74b8e892406e4617c6966f67f8b53e977ce2888b7e9190

Contents?: true

Size: 1012 Bytes

Versions: 3

Compression:

Stored size: 1012 Bytes

Contents

module PageHelpers
    Arachni::Page::ELEMENTS.each do |element|
        element = element.to_s[0...-1]

        define_method "find_#{element}_with_input_from_pages" do |pages, input_name|
            send( "find_page_with_#{element}_with_input", pages, input_name ).
                send("#{element}s").find { |e| e.inputs.include? input_name }
        end

        define_method "find_page_with_#{element}_with_input" do |pages, input_name|
            pages.find do |page|
                page.send("#{element}s").find { |e| e.inputs.include? input_name }
            end
        end

        define_method "pages_should_have_#{element}_with_input" do |pages, input_name|
            send( "find_page_with_#{element}_with_input", pages, input_name ).should be_true
        end

        define_method "pages_should_not_have_#{element}_with_input" do |pages, input_name|
            send( "find_page_with_#{element}_with_input", pages, input_name ).should be_false
        end

    end
end

extend PageHelpers

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
arachni-1.2.1 spec/support/helpers/pages.rb
arachni-1.2 spec/support/helpers/pages.rb
arachni-1.1 spec/support/helpers/pages.rb