Skip to content
This repository was archived by the owner on May 5, 2020. It is now read-only.

Refactor specs #61

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Refactor specs #61

wants to merge 6 commits into from

Conversation

misaka
Copy link
Contributor

@misaka misaka commented Sep 16, 2016

This PR is based off of commits in #59 and requires that that PR be merged first.

This is an attempt to make the specs less brittle, and more focused and expressive. It came out of work being done to add error reporting to the form fields that use fieldsets.

Looking at the govuk elements site there's a bit of inconsistency in how
the HTML should look, but in looking at adding error reporting it looks
like the fieldsets should be inside of form-group divs (as shown in the
HTML source of
https://govuk-elements.herokuapp.com/errors/example-form-validation-single-question-radio).
Styling for errors has been taken from the govuk elements examples here:

https://govuk-elements.herokuapp.com/form-elements/example-form-elements/

Some of the example HTML on the above page is inconsistent with HTML
given as examples here:

https://govuk-elements.herokuapp.com/form-elements/#form-radio-buttons

We've aligned with the HTML from the former link because it seems to
better support errors. This has meant tweaking some of the non-error
HTML, like adding <span> tags around tags in legends.

Also fixed some of the HTML generated so that it doesn't get mangled to
be "HTML-safe".
This removes checking of generated output against static HTML. This
makes specs more focused and more expressive of what they are testing
for, and less brittle at the same time.
Put specs for each of check boxes, collection sets and radio buttons
into their own spec file to reduce the clutter in the form_builder spec.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants