vendredi 4 septembre 2015

Rails routes testing

I am new to testing and I have a question.

This code tests if that route is correct, ok?

test "root should route to home#index" do
assert_routing "/", {controller: "home", action: "index"}
end

How can I test the opposite? I have

resources :sessions, :only=>[:new, :create, :destroy]

In my routes. How would I test that you can't enter sessions#edit?

Could it be that I should not test that?

Aucun commentaire:

Enregistrer un commentaire