में पाठ के साथ अपेक्षित सीएसएस "शीर्षक" रेल में वेब्रेट के स्थान पर कैपिबरा का उपयोग कर रहा हूं। मैंने capybara स्थापित किया है और Gemfile में मणि 'capybara' का उपयोग करें। जब मैंकैपिबरा
page.should have_selector("title", :text => "anything title")
का उपयोग यह नीचे के रूप में है एक त्रुटि
Failure/Error: page.should have_selector("title", :text => "anything title")
expected css "title" with text "anything title" to return something
परीक्षण फ़ाइल देना है:
require 'spec_helper'
describe "Test pages" do
describe "Home page" do
it "should have the content 'Demo App'" do
visit '/test_pages/home'
page.should have_selector("title", :text => "anything title")
end
end
end
क्या आपने कैपिबरा को क्या देख रहा है यह देखने के लिए आपके परीक्षण दावे से ठीक पहले 'save_and_open_page'' करने का प्रयास किया है? – nmott