开发者

where is documentation of Rspec?

开发者 https://www.devze.com 2023-03-23 20:07 出处:网络
I saw have_selector first time today. I want to learn it\'s options, so I went to official site. But I can\'t find it anywhere.

I saw have_selector first time today. I want to learn it's options, so I went to official site.

But I can't find it anywhere.

  • rspec-core
  • rspec-expectation
  • rspec-rails
  • Relish

I used the search feature in each of the above sites, but in vain.

It's just a small, common method, right? But I can't even read it's API... where is it?

Edit: I use Webr开发者_C百科at. Now I know have_selector is from it. But seems no useful documentation.


That is one of Capybara's Rspec matchers: Capybara::RSpecMatchers#have_selector.

You can use that method for querying the page for the existence of certain elements using css or xpath notation (examples from Capybara's Readme):

page.should have_selector('table tr')
page.should have_selector(:xpath, '//table/tr')
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号