Jas*_*Kim 7 rspec ruby-on-rails capybara
有没有一种很好的方法来检查使用rspec和水豚的图像和favicons的存在?
我可以查看favicon和图像的DOM,但我希望能够检查这些图像是否也加载.这对rspec和水豚有可能吗?
describe "check images and favicon" do
  before { visit "url/to/check")
  it "should have the images" do
    page.should have_css('img', text: "image1.jpg")
  it "should have the favicon" do
    page.should have_xpath("/html/head/link[@href='favicon.ico']"
  end 
end
| 归档时间: | 
 | 
| 查看次数: | 4481 次 | 
| 最近记录: |