mercredi 28 décembre 2016

How to test a url which doesn't exist?

I want to validate that an url returns 404 Not found. How can I do that? This doesn't work:

it "404" do
  get "/some_url_404"
  expect(response.status).to eq 404
end

The test itself fails with:

ActionController::RoutingError: No route matches [GET] "/some_url_404"

Aucun commentaire:

Enregistrer un commentaire