RSpec 在我的帮助页面上说一切都很好,但不应该如此。什么会导致误报。(我已经多次重启了我的测试套件)。
这是我的规格页面:
require 'spec_helper'
describe "Static pages" do
subject { page }
shared_examples_for "all static pages" do
it { should have_selector 'h1', text: heading }
it { should have_selector 'title', text: full_title(page_title) }
end
.
.
.
describe "Help page" do
before { visit help_path }
let(:heading) { 'Help' }
let(:page_title) { 'Help' }
end
.
.
.
end
这是我的帮助页面:
<% provide(:title, '') %>
<h1></h1>
<p>
Get help on the Ruby on Rails Tutorial at the
<a href="http://railstutorial.org/help">Rails Tutorial help page</a>.
To get help on this sample app, see the
<a href="http://railstutorial.org/book">Rails Tutorial book</a>.
</p>
就是说测试通过了。怎么修?