Matthew Phelan
3 years ago
2 changed files with 15 additions and 0 deletions
@ -0,0 +1,4 @@
|
||||
<div class="govuk-form-group"> |
||||
<label for="numeric_input"><%= label %></label> |
||||
<input id="numeric_input" class="govuk-input govuk-input--width-20" type="number" /> |
||||
</div> |
@ -0,0 +1,11 @@
|
||||
describe 'questions/_numeric_question.html.erb' do |
||||
context 'when given a label' do |
||||
let(:label) { "Test Label" } |
||||
|
||||
it 'displays a numeric entry field' do |
||||
render :partial => 'numeric_question', locals: { label: label } |
||||
expect(rendered).to have_selector('//input[@type="number"]') |
||||
expect(rendered).to have_selector("//label[contains('#{label}')]") |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue