From 0be88b94592f0f4fd5410b6ae4ac0067ef39c77a Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Mon, 25 Feb 2013 09:56:23 -0800 Subject: [PATCH] test for hover --- lib/capybara/spec/session/node_spec.rb | 9 +++++++++ lib/capybara/spec/views/with_hover.erb | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 lib/capybara/spec/views/with_hover.erb diff --git a/lib/capybara/spec/session/node_spec.rb b/lib/capybara/spec/session/node_spec.rb index f3f88fd0..418ad9db 100644 --- a/lib/capybara/spec/session/node_spec.rb +++ b/lib/capybara/spec/session/node_spec.rb @@ -146,6 +146,15 @@ Capybara::SpecHelper.spec "node" do @session.find('//div[contains(., "Dropped!")]').should_not be_nil end end + + describe '#hover', :requires => [:hover], hover: true do + it "should allow hovering on an element" do + @session.visit('/with_hover') + @session.find(:css,'.hidden_until_hover', visible: false).should_not be_visible + @session.find(:css,'.wrapper').hover + @session.find(:css, '.hidden_until_hover', visible: false).should be_visible + end + end describe '#reload', :requires => [:js] do context "without automatic reload" do diff --git a/lib/capybara/spec/views/with_hover.erb b/lib/capybara/spec/views/with_hover.erb new file mode 100644 index 00000000..67e3dade --- /dev/null +++ b/lib/capybara/spec/views/with_hover.erb @@ -0,0 +1,17 @@ + + + + with_hover + + + + +
+ Some text here so the wrapper has size +
Here I am
+
+ + \ No newline at end of file