Sha256: 1c285c2b7b3bb094eae8bfd3b15656e899b01e97c25406060c724d8c21e36ac5
Contents?: true
Size: 1023 Bytes
Versions: 11
Compression:
Stored size: 1023 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| expect(send( "find_page_with_#{element}_with_input", pages, input_name )).to be_truthy end define_method "pages_should_not_have_#{element}_with_input" do |pages, input_name| expect(send( "find_page_with_#{element}_with_input", pages, input_name )).to be_falsey end end end extend PageHelpers
Version data entries
11 entries across 11 versions & 1 rubygems