Bishma Stornelli
Bishma Stornelli

Reputation: 2569

Rspec matchers evaluating css?

I had some tests using capybara/rspec matchers to check content or links. Anyway, I just changed those to lowercase and used CSS to capitalize the first letter. Now all test fails because the raw html has post instead of Post although it looks like Post.

Is it possible to ignore case or check text after applying css?

Upvotes: 1

Views: 195

Answers (1)

B Seven
B Seven

Reputation: 45943

Capybara supports regular expressions:

find('a', :text => /post/i).click

You might need to use click_link or click_on

Reference on Google Groups

Upvotes: 1

Related Questions