是否可以对以下 html 结构进行测试?
<p class="all-jobs"><%= link_to "<< Back to all jobs", jobs_path %></p>
我试过这样做:
it { should have_selector('p.all-jobs', link: "<< Back to all jobs")}
错误是:
1) JobPages visit a job page
Failure/Error: it { should have_selector('p.all-jobs', link: "<< Back to all jobs")}
expected css "p.all-jobs" to return something
# ./spec/requests/job_pages_spec.rb:78:in `block (3 levels) in <top (required)>'