I'm on rails 3.2 with the conveyor on. I am testing an action that has not yet been built (TDD, trying to run the test first). When I initially ran the test, I get a failure as expected.
class AccountsControllerTest < ActionController::TestCase def test_my_path get :my_path puts @response.body assert_template :my_path end end
When I add the appropriate view (app / views / my_path.html.erb), I still expect the test to fail, since I did not specify a route for this action. It passes though, and I think because the page is being processed by the asset pipeline. In the view, I call <%= request.fullpath %> and invert /assets?action=my_path from the puts @response.body call.
When I try to access the / my _path accounts in the browser, I see "There are no route matches [GET]" / accounts / my _path ", so I want to make sure I have a test too. Why is this happening and how should I fix the test? Should I instead test the route separately with assert_recognizes? To narrow down the source of the problem, my route file is empty.
source share