When I run a file of rspec tests on my Rails application, everything passes except the tests for has_many
associations:
it { should have_many(:notes) } # ERROR
it { should belong_to(:agent_field_set) } # OK
it { should have_and_belong_to_many(:profiles) } # OK
The should have_many(:notes)
line raises ArgumentError: wrong number of arguments (0 for 1)
. I've checked my database and my model file to verify the existance of a has_many
association, and both appear fine:
has_many :notes, class_name: "NoteNs::Note", foreign_key: :user_id
Can anyone tell me where to look for the problem?
Specs: Ruby 1.9.3, Rails 3.2.11