Skip to content

Commit

Permalink
Fix NestedRelatedItem#to_html tests
Browse files Browse the repository at this point in the history
  • Loading branch information
corylown committed Dec 11, 2023
1 parent a16308d commit f0f848b
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions spec/fields/nested_related_item_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,21 @@
let(:mods) { related_item_host_fixture }

it 'renders an unordered list with an embedded dl containing the metadata of the related item' do
within(html.first('dd')) do |dd|
expect(dd).to have_css('ul.mods_display_nested_related_items')
within(dd.find('ul.mods_display_nested_related_items li')) do |li|
expect(li).to have_css('dl dt', text: 'Custom Notes:')
expect(li).to have_css('dl dd', text: 'A note content')
end
expect(html.first('dd')).to have_css('ul.mods_display_nested_related_items')
within(html.first('dd')) do
expect(find('ul.mods_display_nested_related_items li')).to have_css('dl dt', text: 'Custom Notes:')
expect(find('ul.mods_display_nested_related_items li')).to have_css('dl dd', text: 'A note content')
end
end

describe 'with a namespace prefix' do
let(:mods) { namespace_prefixed_related_item_fixture }

it 'renders the list' do
within(html.first('dd')) do |dd|
expect(dd).to have_css('ul.mods_display_nested_related_items')
within(dd.find('ul.mods_display_nested_related_items li')) do |li|
expect(li).to have_css('dl dt', text: 'Constituent Title:')
expect(li).to have_css('dl dd', text: 'Constituent note')
end
expect(html.first('dd')).to have_css('ul.mods_display_nested_related_items')
within(html.first('dd')) do
expect(find('ul.mods_display_nested_related_items li')).to have_css('dl dt', text: 'Constituent Title:')
expect(find('ul.mods_display_nested_related_items li')).to have_css('dl dd', text: 'Constituent note')
end
end
end
Expand Down

0 comments on commit f0f848b

Please sign in to comment.