π Parent Note
π€ Situation
Let's say you use Font Awesome. Then, you want to test that only one map-marker icon is visible on the page.
In other words, you want to find the css.
<i class="fas fa-map-marker"></i>
π Solution
There is Capybara::Node::Matchers#has_css?
. You can also specify the visible count.
like this.
expect(has_css?('i.fa-map-marker', count: 1)).to eq true
Top comments (0)