def check_form(hashtable, fields = [], map = {})
      hashtable, map = wrapper_hash(hashtable), wrapper_hash(map)

      fields = hashtable.keys.map(&:to_sym) if fields.empty?

      fields.each do |f|
        key = f
        key = map[f] if map.key?(f)

        if respond_to? f.to_sym
          el_content = send(f).send(:value)

          expect(el_content).to eq hashtable[key.to_s]
        end
      end
    end
def check_form(hashtable, fields = [], map = {})
      hashtable, map = wrapper_hash(hashtable), wrapper_hash(map)

      fields = hashtable.keys.map(&:to_sym) if fields.empty?

      fields.each do |f|
        key = f
        key = map[f] if map.key?(f)

        if respond_to? f.to_sym
          el_content = send(f).send(:value)

          expect(el_content).to eq hashtable[key.to_s]
        end
      end
    end
usage:
 check_form hashtabe, [:id, :name], {:id => "id2"}
 check_form hashtable, [], {:id => "id2"}
 check_form hashtable
 if the fields is empty, it will use all the keys of the hashtable

 precondition:
 there are the elements mapped to the hashtable keys.