diff --git a/lib/capybara/node/simple.rb b/lib/capybara/node/simple.rb
index 111419ec..7e55abe0 100644
--- a/lib/capybara/node/simple.rb
+++ b/lib/capybara/node/simple.rb
@@ -102,6 +102,7 @@ module Capybara
#
def visible?(check_ancestors = true)
return false if (tag_name == 'input') && (native[:type] == 'hidden')
+ return false if tag_name == 'template'
if check_ancestors
!find_xpath(VISIBILITY_XPATH)
diff --git a/lib/capybara/spec/session/node_spec.rb b/lib/capybara/spec/session/node_spec.rb
index 7a6f74c9..024a2262 100644
--- a/lib/capybara/spec/session/node_spec.rb
+++ b/lib/capybara/spec/session/node_spec.rb
@@ -242,6 +242,7 @@ Capybara::SpecHelper.spec 'node' do
expect(@session.find('//div[@id="hidden_attr"]')).not_to be_visible
expect(@session.find('//a[@id="hidden_attr_via_ancestor"]')).not_to be_visible
expect(@session.find('//input[@id="hidden_input"]')).not_to be_visible
+ expect(@session.find('//template')).not_to be_visible
end
it 'should be boolean' do
diff --git a/lib/capybara/spec/views/with_html.erb b/lib/capybara/spec/views/with_html.erb
index 26e265b1..8ff022f9 100644
--- a/lib/capybara/spec/views/with_html.erb
+++ b/lib/capybara/spec/views/with_html.erb
@@ -178,5 +178,9 @@ banana
+
+
+
+
Download Me
Download Other