From 274d4fa0c5be7bb750c2e8e4cfa1a23e4a4a4933 Mon Sep 17 00:00:00 2001 From: Kanezoh Date: Sat, 19 Jun 2021 06:50:35 +0900 Subject: [PATCH] add dom_id,class test --- spec/form/field_spec.cr | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/spec/form/field_spec.cr b/spec/form/field_spec.cr index 26365f1..1731b28 100644 --- a/spec/form/field_spec.cr +++ b/spec/form/field_spec.cr @@ -9,7 +9,7 @@ WebMock.stub(:get, "example.com/form/fields").to_return(body:
- +
@@ -27,4 +27,14 @@ describe "Form Fields" do field.value.should eq "kanezoh" field.raw_value.should eq "kanezoh" end + + it "returns DOM id and class" do + field = form.fields.first + # dom_id and class returns empty string if there are no id, class + field.dom_id.should eq "" + field.dom_class.should eq "" + field = form.fields[1] + field.dom_id.should eq "emailID" + field.dom_class.should eq "emailClass" + end end