Adding some spec tests around setting a page as the home page

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-11-30 14:00:21 -08:00
parent b136fbe02b
commit f512e634b1
3 changed files with 150 additions and 27 deletions

View File

@@ -213,6 +213,23 @@ namespace Orchard.Specs.Bindings {
else if (radio.Attributes.Contains("checked"))
radio.Attributes.Remove("checked");
}
break;
case "checkbox":
if (string.Equals(row["value"], "true", StringComparison.OrdinalIgnoreCase)) {
input.Attributes.Add("checked", "checked");
}
else {
input.Attributes.Remove("checked");
}
var hiddenForCheckbox = inputs.Where(
x =>
x.GetAttributeValue("type", "") == "hidden" &&
x.GetAttributeValue("name", x.GetAttributeValue("id", "")) == r["name"]
).FirstOrDefault();
if (hiddenForCheckbox != null)
hiddenForCheckbox.Attributes.Add("value", row["value"]);
break;
default:
input.Attributes.Add("value", row["value"]);