From 6c2a942809db2f5eda2c7f031a111e22b2939b1a Mon Sep 17 00:00:00 2001 From: Kanezoh Date: Wed, 16 Jun 2021 15:23:48 +0900 Subject: [PATCH] wip checkbox test --- spec/form_spec.cr | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/spec/form_spec.cr b/spec/form_spec.cr index c5ffe76..50c4d78 100644 --- a/spec/form_spec.cr +++ b/spec/form_spec.cr @@ -44,6 +44,23 @@ describe "Mechanize Form test" do context "Form Fields CheckBox" do checkbox = form.checkboxes.first - p checkbox.checked? + it "returns checkbox status" do + checkbox.checked?.should eq true + end + it "can change check status" do + checkbox.checked?.should eq true + checkbox.uncheck + checkbox.checked?.should eq false + checkbox.check + checkbox.checked?.should eq true + # #click reverses check status + checkbox.click + checkbox.checked?.should eq false + checkbox.click + checkbox.checked?.should eq true + end + it "returns query value" do + p checkbox.query_value + end end end