mardi 31 octobre 2017

If I want to change the route in a test controllers file, do I have to edit any other files?

I want to change the route in this file from users_new_url to signup_path:

require 'test_helper'

class UsersControllerTest < ActionDispatch::IntegrationTest
  test "should get new" do
    get users_new_url
    assert_response :success
  end

end

I have tried simply replacing it,

get signup_path

but when I run rails test, it always says that signup_path is an "undefined local variable or method". Do I need to edit other files?

If it helps, the following code is from test/controllers/users_controller_test.rb.

Aucun commentaire:

Enregistrer un commentaire