Tag: capybara railstutorial.org

rails教程期望css标题与文本返回一些东西

我正在研究ruby.railstutorial.org上的RoR教程,目前正在第4章。测试没有validation,我不明白为什么。 我的spec文件的顶部部分看起来像这样。 其他方法看起来与帮助相同: describe “StaticPages” do let(:page_title) {“Ruby on Rails Tutorial Sample App”} let(:h1_test) {“should have the h1”} let(:title_test) {“should have the title”} describe “Home page” do |title_test, h1_test| it “#{h1_test} ‘Sample App'” do visit ‘/static_pages/home’ page.should have_selector(‘h1′,:text=>’Sample App’) end it “#{title_test} ‘Home'” do visit ‘/static_pages/home’ page.should have_selector(‘title’, :text=> ‘#{page_title}’) end it “should not have […]