I get this RSpec error when I try to embed one document in another. Sorry, I’m new to MongoDB. I’m used to sqlite3 and pg. I guess I just don’t know how to test this sort of relation. Can someone help me out?
Player attributes validations should require a name
Failure/Error: @hero = Player.create!(@attr)
NoMethodError:
undefined method `validated?' for #<Hash:0x007fb33f41dc88>
# ./spec/models/player_spec.rb:9:in `block (3 levels) in <top (required)>'
My validation is just a simple
validates_presence_of
Here’s my source code.
The problem is your use of the class name Attribute – it’s clashing with something else. Field also won’t work.