jonleighton / focused_controller

MIT License
468 stars 27 forks source link

Consider removing custom assertions #10

Closed jonleighton closed 12 years ago

jonleighton commented 12 years ago

Look into whether it's possible/practical to remove e.g. assert_redirected_to foo in favour of assert_equal foo, response.redirected_url.

jeremyf commented 12 years ago

I ever so slightly lean towards assert_equal as this would be one less thing to mentally juggle on what could be a "new concept" for someone. For me assert_redirected_to implies a bit more of the application stack. So assert_equal to me makes sense in the Unit test, assert_redirected_to makes sense in the Integration test.

jonleighton commented 12 years ago

Oops, referenced the wrong issue in that commit.

jonleighton commented 12 years ago

I think I will leave this actually, because being able to write e.g. assert_redirected_to @post can be useful. There is already a response.location method that can be asserted, anyway.