diff --git a/spec/select2_v2_spec.rb b/spec/select2_v2_spec.rb index 04dd313..c673d2f 100644 --- a/spec/select2_v2_spec.rb +++ b/spec/select2_v2_spec.rb @@ -38,7 +38,7 @@ context 'when searching for an option within a block' do it 'should select an option from search results' do - Capybara.within '#single' do + within '#single' do select2 'Wii', css: '.select2-container', search: true end expect(page).to have_css '.select2-container span', text: 'Wii' diff --git a/spec/select2_v3_spec.rb b/spec/select2_v3_spec.rb index 07f25c9..0fef0c9 100644 --- a/spec/select2_v3_spec.rb +++ b/spec/select2_v3_spec.rb @@ -36,7 +36,7 @@ context 'when searching for an option within a block' do it 'should select an option from search results' do - Capybara.within '#single' do + within '#single' do select2 'Wii', css: '.select2-container', search: true end expect(page).to have_css '.select2-container span', text: 'Wii' diff --git a/spec/select2_v4_spec.rb b/spec/select2_v4_spec.rb index f9ccb9a..2ab3591 100644 --- a/spec/select2_v4_spec.rb +++ b/spec/select2_v4_spec.rb @@ -36,7 +36,7 @@ context 'when searching for an option within a block' do it 'should select an option from search results' do - Capybara.within '#single' do + within '#single' do select2 'Wii', css: '.select2-container', search: true end expect(page).to have_css '.select2-container span', text: 'Wii'