Ruby on rails 3 如何编写rspec测试以正确检查图像是否已渲染?

Ruby on rails 3 如何编写rspec测试以正确检查图像是否已渲染?,ruby-on-rails-3,rspec,Ruby On Rails 3,Rspec,我正在为我的Rails应用程序编写电子邮件测试,但我不知道如何测试电子邮件中是否正确包含图像。我已经尝试了have_内容,have_标签,还到处搜索,但似乎找不到合适的方法 必须有一些简单的方法来测试这个,除非我遗漏了什么 这就是我目前所拥有的 describe "registration email" do it "has the right logo image" do email.body.should have_tag("img[src='www.mysite.com/ass

我正在为我的Rails应用程序编写电子邮件测试,但我不知道如何测试电子邮件中是否正确包含图像。我已经尝试了have_内容,have_标签,还到处搜索,但似乎找不到合适的方法

必须有一些简单的方法来测试这个,除非我遗漏了什么

这就是我目前所拥有的

describe "registration email" do
  it "has the right logo image" do
    email.body.should have_tag("img[src='www.mysite.com/assets/logo.png']")
  end
end
但是得到这个错误:

NoMethodError:
   undefined method `has_tag?' for :Mail::Body