I was running through the Test Driven Rails trail, and in the fourth video, “Signing In…” about 19mins in, Josh puts
ToDo.create!(title: "Buy milk", email: "email@example.com")
in the spec, but when I run this I’m getting
Failure/Error: ToDo.create!(title: "Buy milk", email: "firstname.lastname@example.org") NameError: uninitialized constant ToDo # ./spec/features/user_sees_own_todos_spec.rb:5:in `block (2 levels) in <top (required)>'
I’m using Rails 5.0.2, and guessing it’s something to do with the version differences, but not sure how to fix it.
How do you load/add the model into the spec, I’ve googled a bunch of things for this, but they all seem to point to the
require 'rails_helper' which is already in the spec.
Any suggestions would be awesome.