Skip to content

Commit

Permalink
Update checkboxes data-module to govuk-checkboxes
Browse files Browse the repository at this point in the history
This change is required due to new approach to namespacing[0] in V3.0
of the GOV.UK Design System

[0] alphagov/govuk-frontend#1443
  • Loading branch information
peteryates committed Aug 2, 2019
1 parent 3b264de commit 9fa5670
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize(builder, small:)
end

def html
@builder.content_tag('div', class: check_boxes_classes, data: { module: 'checkboxes' }) do
@builder.content_tag('div', class: check_boxes_classes, data: { module: 'govuk-checkboxes' }) do
yield
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@

describe 'check boxes' do
specify 'output should contain the correct number of check boxes' do
expect(subject).to have_tag('input', count: projects.size, with: { type: 'checkbox' })
expect(subject).to have_tag('label', count: projects.size)
expect(subject).to have_tag('div', with: { 'data-module' => 'govuk-checkboxes' }) do |cb|
expect(cb).to have_tag('input', count: projects.size, with: { type: 'checkbox' })
expect(cb).to have_tag('label', count: projects.size)
end
end

context 'check box size' do
Expand Down Expand Up @@ -173,7 +175,7 @@
end

specify 'output should contain check boxes' do
expect(subject).to have_tag('div', with: { class: 'govuk-checkboxes', 'data-module' => 'checkboxes' }) do
expect(subject).to have_tag('div', with: { class: 'govuk-checkboxes', 'data-module' => 'govuk-checkboxes' }) do
expect(subject).to have_tag('input', with: { type: 'checkbox' }, count: 3)
end
end
Expand Down

0 comments on commit 9fa5670

Please sign in to comment.