Rails, RSpec and Webrat: Expected output matches rendered output but still getting error in view spec

余生长醉 提交于 2019-12-03 16:16:30

If you want to keep the block try using rspec-rails matchers instead of the webrat matchers.

describe "backend/posts/create.html.erb" do  
  it "should render a form to create a post" do
    render "backend/posts/create.html.erb"
    response.should have_tag("form[method=post][action=?]", b_posts_path) do |form|
      with_tag('input')
      # ... etc
    end
  end
end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!