मैं अपने परीक्षण सूट में परीक्षण सही swapping of a stylesheet की क्षमता रखना चाहता हूं। इस पोस्ट के साथ testing the page title using Capybara, मैंने सोचा कि मैं पृष्ठ के head
अनुभाग में link
टैग का परीक्षण करने में सक्षम हूं। लेकिन ऐसा लगता है कि मैं गलत हूँ।कैपिबरा: किसी पृष्ठ की स्टाइलशीट का परीक्षण कैसे करें?
save_and_open_page
page.should have_xpath("//link") # just something as simple as this, first.
save_and_open_page
(संक्षिप्तता के लिए हटाया कुछ सामान के साथ) इस तरह एक HTML उत्पन्न करता है:
<head>
...
<link href="/home/ramon/source/unstilted/public/system_test/stylesheets/fancake/css/2.css?1323572998" type="text/css" class="jquery-styler" rel="stylesheet">
...
</head>
लेकिन मैं इस विफलता मिलती है:
expected xpath "//link" to return something (RSpec::Expectations::ExpectationNotMetError)
इस तरह एक कदम के साथ
यह सब देखते हुए, मैं स्टाइलशीट का परीक्षण कैसे करूं?
धन्यवाद!