2012年12月5日水曜日

Rails Tutorial Chapter3 Title test does not work #rails

Listing 3.17
it "should have the right title" do
 visit '/static_pages/home'
 page.should have_selector('title', :text => "Ruby on Rails Tutorial Sample App | Home")
end

Capybara2.0.1 does not work ( ̄0 ̄)
Also found "", which matched the selector but not all filters.

Updated
it "should have the right title" do
 visit '/static_pages/home'
 should have_xpath("//title[contains(.,'Ruby on Rails Tutorial Sample App | Home')]")
end

It Worked ヘ(^o^)ノ

or
gem 'capybara', '1.1.2'


0 件のコメント:

コメントを投稿