简体   繁体   中英

Ruby on Rails Test Stopped Working

I was running tests without a problem on a cloud9 console. I made what I thought was a basically inconsequential change in my code to fix a testing fail, and got this error message:

rake aborted! NameError: undefined local variable or method `migrateRails' for main:Object

The change I made was just to add a function to a controller, nothing to do with the test gem. I reinstalled the bundle and ran the test again. Same error.

I undid the change in the controller. Same error.

Thanks.

I think I find my error: when I wrote the test I didn't put "end" at the end of the test.

I did:

  test "should get contact" do
get :contact
assert_response :success
assert_select "title", "Contact | Ruby on Rails Tutorial Sample App"

and I should have done:

  test "should get contact" do
get :contact
assert_response :success
assert_select "title", "Contact | Ruby on Rails Tutorial Sample App"
end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM