Skip to content

Commit a5fbdbf

Browse files
committed
make test resilient to special characters
1 parent ddc3e31 commit a5fbdbf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spec/features/resources_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@
313313
it 'displays the thumbnail' do
314314
expect(page).to have_css("img[src='url.com/path/file']")
315315
expect(page).to have_css('.thumbnail-card')
316-
expect(page).to have_css("img[alt='Thumbnail image for #{work.title}']")
316+
thumbnail_img = page.find("img[src='url.com/path/file']")
317+
expect(thumbnail_img['alt']).to eq("Thumbnail image for #{work.latest_published_version.title}")
317318
end
318319
end
319320
end
@@ -440,7 +441,8 @@
440441
it 'displays the thumbnail' do
441442
expect(page).to have_css("img[src='url.com/path/file']")
442443
expect(page).to have_css('.thumbnail-card')
443-
expect(page).to have_css("img[alt='Thumbnail image for #{collection.title}']")
444+
thumbnail_img = page.find("img[src='url.com/path/file']")
445+
expect(thumbnail_img['alt']).to eq("Thumbnail image for #{collection.title}")
444446
end
445447
end
446448
end

0 commit comments

Comments
 (0)