ri > Capybara::RSpecMatchers::Matchers::HaveSibling

```html

⚙️ Capybara::RSpecMatchers::Matchers::HaveSibling < Capybara::RSpecMatchers::Matchers::CountableWrappedElementMatcher

(from /home/chedong/.local/share/rdoc)


📘 NAME

Capybara::RSpecMatchers::Matchers::HaveSibling — A matcher for checking if an element has a sibling that matches given criteria.

🚀 Quick Reference

Use CaseCommandDescription
Check element has a sibling with specific textexpect(page).to have_sibling('Some text')🏷️ Verifies that the current element has a sibling element containing the exact text.
Check element has a sibling matching CSS selectorexpect(page).to have_sibling('.my-class')🎯 Verifies that the current element has a sibling matching the given CSS selector.
Check element does not have a siblingexpect(page).to have_no_sibling('irrelevant')🚫 Verifies that the current element does not have a sibling matching the criteria.

🔧 Instance Methods


Note: This page is based on the original RDoc documentation. All emoji enhancements are added for scannability.

```
Capybara::RSpecMatchers::Matchers::HaveSibling
⚙️ Capybara::RSpecMatchers::Matchers::HaveSibling < Capybara::RSpecMatchers::Matchers::CountableWrappedElementMatcher 📘 NAME 🚀 Quick Reference 🔧 Instance Methods

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-27 17:41 @216.73.216.199
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format