Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 1.67 KB

WISHLIST.md

File metadata and controls

37 lines (29 loc) · 1.67 KB

default forms to being remote

We disabled remote forms when using form_with because things like flash messages don't show up when we re-render. Maybe we can come up with a way of adding a layout/application.js.haml to insert flashes into the page dynamically. We'll want to remove the following configuration:

Rails.application.config.action_view.form_with_generates_remote_forms = false

build tool to sync server validation messages with HTML5 validations

Right now HTML5 validation has different messages on each browser. Ideally we would show the same validation messages that come up when validating ActiveRecord models. We should build a tool that uses setCustomValidity to customize the message to match what appears on the server. This would also help us to test validations in system tests against both Rack::Test, Chrome, and Firefox.

make generic matchers for testing form errors with and without JS

Rack::Test does not implement HTML5 validation, so when submitting a form it relies on server-side validation and the followup error messages when it re-renders the form. Browsers, on the other hand, implement HTML5 validation, so when testing against Firefox or Chrome, it prevents submitting the form in the first place. When asserting against error messages in system tests, we should have a tool that takes into account which driver is being used and search for the error either in an errors div in the case of Rack::Test or for JS enabled browsers we should be able to use:

page.find("#field_id").native.attribute("validationMessage")

This depends on the error messages being the same both in HTML5 validations and in server rendered errors.