add normal button
parent
a1e57c5ca9
commit
4df61c7906
|
@ -24,6 +24,7 @@ WebMock.stub(:get, "example.com/check_form").to_return(body:
|
|||
<input type="reset" value="no">
|
||||
<input type="submit" value="submit">
|
||||
<input type="image" src="images/kaeru.png" alt="gerogero">
|
||||
<button class="favorite styled" type="button">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -48,6 +49,6 @@ describe "Mechanize Form test" do
|
|||
form.fields.size.should eq 4
|
||||
form.checkboxes.size.should eq 1
|
||||
form.radiobuttons.size.should eq 3
|
||||
form.buttons.size.should eq 4
|
||||
form.buttons.size.should eq 5
|
||||
end
|
||||
end
|
||||
|
|
|
@ -91,6 +91,13 @@ class MechanizeCr::Form
|
|||
next if node["name"].empty?
|
||||
@fields << FormContent::Textarea.new(node, node.inner_text)
|
||||
end
|
||||
|
||||
@node.css("button").each do |node|
|
||||
node = node.as(Myhtml::Node)
|
||||
type = node.fetch("type", "submit").downcase
|
||||
next if type == "reset"
|
||||
@buttons << FormContent::Button.new(node, @node)
|
||||
end
|
||||
end
|
||||
|
||||
private def build_query_string(params : Array(Array(String)))
|
||||
|
|
Loading…
Reference in New Issue