我在 requests/pages_spec.rb 下有这两个测试
pages_spec.rb
require 'spec_helper'
describe "Pages" do
subject { page }
before { visit root_path }
describe "Home page" do
it { should have_selector('a', text: 'Post your property')}
it { should have_link('Post your property', href: new_apartment_path)}
end
end
第一个测试通过,第二个测试失败说:
expected link "Post your property" to return something
这是html:
<a href="/en/apartment/new">Post your property</a>
知道为什么测试失败了吗?谢谢!乌里