Given a controller method like:
def show @model = Model.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => model } end end
What’s the best way to write an integration test that asserts that the return has the expected XML?
A combination of using the format and assert_select in an integration test works great:
For more details check out assert_select in the Rails docs.