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

Remove duplicated name input field html expectation #71

Conversation

robmckinnon
Copy link
Contributor

@robmckinnon robmckinnon commented Nov 25, 2016

Add a method to generate expected html output for a name input field.

Replace duplicated name input field html expectations in the form builder spec with calls to the method. Change parameters to change the expected html in the small number of places it varies.

This approach keeps the html expectation as html text. The intention is to make it easy for developers doing frontend to see the generated markup in the test expectation. It allows you to quickly compare against example markup from the form section of the GOV.UK elements guide.

Some duplication in test expectations is acceptable when it leads to expectations that are concise and easy to read and reason about.

An alternate pull request #69 to remove this duplication created a FormGroupObject model to perform tests. This different approach lost having the expected html output easily readable in a few lines of code.

Add a method to generate expected html output for a name
input field.

Replace duplicated name input field html expectations in the
form builder spec with calls to the method. Change parameters
to change the expected html in the small number of places it
varies.

This approach keep the html expectation as html text. The intention
is to make it easy for developers doing frontend to see the
generated markup in the test expectation.

Some duplication in test expectations is acceptable when it leads
to expectations that are concise and easy to read and reason about.

An alternate pull request to remove this duplication created a
FormGroupObject model to perform tests. This different approach
lost having the expected html output easily readable in a few lines
of code.
@aliuk2012
Copy link
Contributor

@ministryofjustice/ruby need some reviews.

@aliuk2012 aliuk2012 merged commit 4505498 into ministryofjustice:master Feb 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants