【发布时间】:2013-02-05 13:33:07
【问题描述】:
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>
表示测试通过。如何解决?
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 rspec rspec2