From 6d559620c01fd07a8f55251fb1af53507418ddf8 Mon Sep 17 00:00:00 2001 From: Chet Gray Date: Mon, 14 Jan 2019 00:25:46 +0000 Subject: [PATCH] Add spec: display wrapped matches in matching order There's no special rendering to note that the match wraps. Perhaps we should consider that? See contradb/contra#553 --- spec/features/welcome/index_spec.rb | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/spec/features/welcome/index_spec.rb b/spec/features/welcome/index_spec.rb index fd74dd4b..0f223794 100644 --- a/spec/features/welcome/index_spec.rb +++ b/spec/features/welcome/index_spec.rb @@ -949,15 +949,26 @@ def setup_and_filter end end - it 'figures column' do - dances - visit '/' - expect(page).to_not have_content('whole dance') - click_button 'Figures' - expect(page).to have_content('whole dance', count: 3) - select('circle') - expect(page).to have_css('tr', text: /The Rendevouz.*circle left 4 places\ncircle left 3 places/) - expect(page).to have_css('tr', text: /Call Me.*circle left 3 places/) + describe 'figures column' do + it 'works' do + dances + visit '/' + expect(page).to_not have_content('whole dance') + click_button 'Figures' + expect(page).to have_content('whole dance', count: 3) + select('circle') + expect(page).to have_css('tr', text: /The Rendevouz.*circle left 4 places\ncircle left 3 places/) + expect(page).to have_css('tr', text: /Call Me.*circle left 3 places/) + end + + it 'displays wrapped matches in matching order' do + dance = FactoryGirl.create(:box_the_gnat_contra) + visit '/' + click_button 'Figures' + select('then') + select('chain', match: :first) + expect(page).to have_css('tr', text: /Box the Gnat Contra.*chain ⁋\nneighbors balance & box the gnat/) + end end end end