Retorna o nome errado do teste quando dá erro na view
Closed this issue · 6 comments
marcocarvalho commented
$ rake
......E.
1) test should get index
ActionView::Template::Error: 795: unexpected token at '{'1':'aaa'}'
app/views/endpoints/index.html.haml:20:in `block in _app_views_endpoints_index_html_haml__1748992618101548792_72657940'
(...)
# test/controllers/endpoints_controller_test.rb:9:in `block in <class:EndpointsControllerTest>'
Finished in 0.235216s, 34.0112 runs/s, 51.0169 assertions/s.
8 runs, 12 assertions, no failures, 1 error, no skips
Failed Tests:
rake TEST=app/views/endpoints/index.html.haml TESTOPTS="--name=test_should_get_index"
Teste:
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:endpoints)
end
Controller (scaffold cru)
class EndpointsController < ApplicationController
before_action :set_endpoint, only: [:show, :edit, :update, :destroy]
def index
@endpoints = Endpoint.all
end
#...
end
fnando commented
Como assim nome errado? Nome do teste?
marcocarvalho commented
Yeap
rake TEST=app/views/endpoints/index.html.haml TESTOPTS="--name=test_should_get_index"
fnando commented
E como você acha que deveria ser?
marcocarvalho commented
rake TEST=test/controllers/endpoints_controller_test.rb TESTOPTS="--name=test_should_get_index" ?
pois app/views/endpoints/index.html.haml é a view.. não o teste :)
fnando commented
Então não é o nome errado, mas arquivo errado. Ótimo! Vou tentar corrigir aqui. :)
fnando commented
Acabei de liberar v0.1.2. Obrigado por abrir o ticket.