-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #452 from alphagov/test-component-guide
Test component guide
- Loading branch information
Showing
5 changed files
with
27 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<% | ||
alt ||= false | ||
alt ||= '' | ||
caption ||= false | ||
%> | ||
<figure class="app-c-figure"> | ||
<img class="app-c-figure__image" src="<%= src %>" <% if alt %>alt="<%= alt %>"<% end %>> | ||
<img class="app-c-figure__image" src="<%= src %>" alt="<%= alt %>"> | ||
<% if caption %><figcaption class="app-c-figure__figcaption"><%= caption %></figcaption><% end %> | ||
</figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'test_helper' | ||
|
||
# TODO: Move this logic to the GOVUK Publishing Components gem | ||
# and have the tests visit each component. | ||
class AllComponentsTest < ActionDispatch::IntegrationTest | ||
test "renders all component guide pages without erroring" do | ||
visit '/component-guide' | ||
components = all(:css, '.component-list a').map do |el| | ||
"#{el[:href]}/preview" | ||
end | ||
components.each do |component| | ||
visit component | ||
end | ||
end | ||
end |