-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! Use tidy-html5 to validate the term-table page
- Loading branch information
1 parent
9077149
commit 3df7f00
Showing
3 changed files
with
47 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# frozen_string_literal: true | ||
require 'test_helper' | ||
require_relative '../../../app' | ||
|
||
describe 'Bahamas' do | ||
subject { Nokogiri::HTML(last_response.body) } | ||
let(:hubert) { subject.css('#mem-4a7bfd46-3b03-46ec-957f-3ef526b04bbe') } | ||
let(:damian) { subject.css('#mem-58709524-7f66-44fd-8315-9712c4655768') } | ||
let(:philip) { subject.css('#mem-dcd1a356-a7e6-409b-8028-27fea2691105') } | ||
|
||
before do | ||
stub_popolo('4da60b8', 'Bahamas/House_of_Assembly') | ||
get '/bahamas/house-of-assembly/term-table/2012.html' | ||
end | ||
|
||
describe 'alt attribute on avatars' do | ||
it 'has the person name in a normal image' do | ||
img = hubert.css('img.person-card__image')[0] | ||
img.attr('alt').must_equal 'Member headshot for Hubert Chipman' | ||
end | ||
|
||
it 'has the person name in a normal image when JS is disabled' do | ||
img = hubert.css('img.person-card__image')[1] | ||
img.attr('alt').must_equal 'Member headshot for Hubert Chipman' | ||
end | ||
|
||
it 'has the person name in a placeholder image' do | ||
img = damian.css('img.person-card__image') | ||
img.attr('alt').text.must_equal 'Placeholder image for Damian Gomez' | ||
end | ||
|
||
it 'doesnt break for names with double quotes' do | ||
img = philip.css('img.person-card__image')[0] | ||
img.attr('alt').must_equal 'Member headshot for Philip "Brave" Davis' | ||
end | ||
end | ||
|
||
describe 'HTML validation' do | ||
it 'has no errors in the term-table page' do | ||
last_response_must_be_valid | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
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