tomekfranek
tomekfranek

Reputation: 7099

how to check span class by capybara

How to check how many <span class=error>error text</span> is on page?

The code below is not working:

should have_selector('span.error', :count => 5)

Upvotes: 1

Views: 969

Answers (1)

Marek Př&#237;hoda
Marek Př&#237;hoda

Reputation: 11198

From the docs:

all('a').each { |a| a[:href] }

So something like the following should be possible:

all('span.error').count.should == 5

Upvotes: 1

Related Questions