Skip to content

Commit

Permalink
Fixes #36 - use phantomjs-gem version 1.9.8.0 to match the version pr…
Browse files Browse the repository at this point in the history
…einstalled on travis

Merge pull request #37 from UKHomeOffice/devtask/36-fix-version-of-phantomjs

Fixes #36 - use phantomjs-gem version 1.9.8.0 to match the version pr…
fixes #33 - validation errors on first page relating to date

fixed 2 typos in comments regarding overriding required validtion

merged in master
  • Loading branch information
joefitter committed Apr 8, 2016
1 parent 402fd8b commit 370a05a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 14 deletions.
4 changes: 2 additions & 2 deletions acceptance_tests/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ source "https://rubygems.org"

gem 'cucumber'
gem 'capybara'
gem 'rspec'
gem 'poltergeist'
gem 'phantomjs', :group => :test
gem 'rspec'
gem 'phantomjs', '1.9.8.0'
gem 'show_me_the_cookies'
gem 'yard-cucumber'
gem 'selenium-webdriver', '2.45.0'
10 changes: 7 additions & 3 deletions apps/my_awesome_form/controllers/first-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ var FirstPageController = function FirstPageController() {

util.inherits(FirstPageController, DateController);

FirstPageController.prototype.validateField = function validateField(keyToValidate, req) {
return DateController.prototype.validateField.call(this, keyToValidate, req, false);
};
/*
* The validateField method can be overidden in the following way to
* always allow date to be omitted, regardless of settings in fields directory
*/
// FirstPageController.prototype.validateField = function validateField(keyToValidate, req) {
// return DateController.prototype.validateField.call(this, keyToValidate, req, false);
// };

module.exports = FirstPageController;
4 changes: 3 additions & 1 deletion apps/my_awesome_form/fields/first-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ module.exports = {
}]
},
'example-dob': {
validate: ['required', 'numeric'],
legend: 'fields.example-dob.legend',
hint: 'fields.example-dob.hint'
},
'example-dob-day': {
validate: ['required', 'numeric'],
label: 'fields.example-dob-day.label'
},
'example-dob-month': {
validate: ['required', 'numeric'],
label: 'fields.example-dob-month.label'
},
'example-dob-year': {
validate: ['required', 'numeric'],
label: 'fields.example-dob-year.label'
},
'example-text': {
Expand Down
2 changes: 1 addition & 1 deletion apps/my_awesome_form/translations/src/en/validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
"multiples-input": {
"multipleError": "That isn't a multiple of 3, try again!"
}
}
}
16 changes: 9 additions & 7 deletions apps/my_awesome_form/views/first-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,17 @@ <h1>Example date group</h1>
{{#input-date}}example-dob{{/input-date}}
</div>

<h1>Example text input</h1>
{{#input-text}}example-text{{/input-text}}
<h1>Example text input with validation for email address</h1>
{{#input-text}}example-email{{/input-text}}
<h1>Example checkbox</h1>
{{#checkbox}}example-checkbox{{/checkbox}}

</fieldset>


<h1>Example text input</h1>
{{#input-text}}example-text{{/input-text}}
<h1>Example text input with validation for email address</h1>
{{#input-text}}example-email{{/input-text}}
<h1>Example checkbox</h1>
{{#checkbox}}example-checkbox{{/checkbox}}


{{#input-submit}}continue{{/input-submit}}
{{/form}}

Expand Down

0 comments on commit 370a05a

Please sign in to comment.