Skip to content

Commit

Permalink
Fixing bug in form tag where it did not have a closing tag by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mtscout6 committed Feb 14, 2014
1 parent 04ca4df commit d232442
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BUILD_VERSION = "2.0.0"
BUILD_VERSION = "2.1.0"
15 changes: 10 additions & 5 deletions src/HtmlTags.Testing/ElementTesters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,37 +45,42 @@ public class FormTagTester
public void form_tag_creates_the_opening_element_of_a_form_with_id_mainForm()
{
var tag = new FormTag();
tag.ToString().ShouldEqual("<form method=\"post\">");
tag.Attr("method").ShouldEqual("post");
}

[Test]
public void form_id_can_be_customized()
{
var tag = new FormTag().Id("other-form");
tag.ToString().ShouldEqual("<form method=\"post\" id=\"other-form\">");
tag.Id().ShouldEqual("other-form");
}

[Test]
public void form_method_can_be_customized()
{
var tag = new FormTag().Method("get");
tag.ToString().ShouldEqual("<form method=\"get\">");
tag.Attr("method").ShouldEqual("get");
}

[Test]
public void form_action_can_be_specified()
{
var tag = new FormTag().Action("/user/create");
tag.ToString().ShouldEqual("<form method=\"post\" action=\"/user/create\">");
tag.Attr("action").ShouldEqual("/user/create");
}

[Test]
public void form_action_can_be_specified_via_constructor()
{
var tag = new FormTag("/user/create");
tag.ToString().ShouldEqual("<form method=\"post\" action=\"/user/create\">");
tag.Attr("action").ShouldEqual("/user/create");
}

[Test]
public void form_tag_has_closing_tag_by_default()
{
new FormTag().HasClosingTag().ShouldBeTrue();
}
}

[TestFixture]
Expand Down
1 change: 0 additions & 1 deletion src/HtmlTags/FormTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public FormTag(string url) : this()

public FormTag() : base("form")
{
NoClosingTag();
Method("post");
}

Expand Down

0 comments on commit d232442

Please sign in to comment.