From edb5e88e7a53bb046ee36a75a1eb65314c953535 Mon Sep 17 00:00:00 2001 From: Volodymyr Mykhailyk <712680+volodymyr-mykhailyk@users.noreply.github.com> Date: Wed, 20 May 2020 09:59:17 +0300 Subject: [PATCH] Fix issue when drag begins before dragula is initialized --- lib/capybara/spec/session/node_spec.rb | 2 +- lib/capybara/spec/views/with_dragula.erb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/capybara/spec/session/node_spec.rb b/lib/capybara/spec/session/node_spec.rb index be449e63..d6d48b19 100644 --- a/lib/capybara/spec/session/node_spec.rb +++ b/lib/capybara/spec/session/node_spec.rb @@ -446,7 +446,7 @@ Capybara::SpecHelper.spec 'node' do it 'should work with Dragula' do @session.visit('/with_dragula') - @session.within(:css, '#sortable') do + @session.within(:css, '#sortable.ready') do src = @session.find('div', text: 'Item 1') target = @session.find('div', text: 'Item 3') src.drag_to target diff --git a/lib/capybara/spec/views/with_dragula.erb b/lib/capybara/spec/views/with_dragula.erb index d788e4b9..cb68ef8b 100644 --- a/lib/capybara/spec/views/with_dragula.erb +++ b/lib/capybara/spec/views/with_dragula.erb @@ -15,7 +15,9 @@