diff --git a/Test/View/FormSpec.hs b/Test/View/FormSpec.hs index cb47028b8..e5d32cb75 100644 --- a/Test/View/FormSpec.hs +++ b/Test/View/FormSpec.hs @@ -29,7 +29,7 @@ tests = do {submitButton} |] form `shouldRenderTo` "
" - + it "should render a form with a GET method" do context <- createControllerContext let ?context = context @@ -42,6 +42,19 @@ tests = do |] form `shouldRenderTo` "" + it "should render a form with disabled button" do + context <- createControllerContext + let ?context = context + + let options formContext = formContext |> set #formMethod "GET" + + let form = formForWithOptions project options [hsx| + {textField #title} + {submitButton {disabled = True}} + |] + form `shouldRenderTo` "" + + shouldRenderTo renderFunction expectedHtml = Blaze.renderMarkup renderFunction `shouldBe` expectedHtml createControllerContext :: IO ControllerContext @@ -54,7 +67,7 @@ createControllerContext = do data Project' = Project {id :: (Id' "projects"), title :: Text, meta :: MetaBag} deriving (Eq, Show) instance InputValue Project where inputValue = IHP.ModelSupport.recordToInputValue -type Project = Project' +type Project = Project' type instance GetTableName (Project' ) = "projects" type instance GetModelByTableName "projects" = Project