sjstebbins / Relephant

6 stars 0 forks source link

Shoulda Matchers Recognizing Wrong Association #1

Open jemise111 opened 10 years ago

jemise111 commented 10 years ago

We have set up a has and belongs to many association between our 'entries' table and our 'words' table. The association is set in the models and the join table has been created and migrated.

We are using shoulda-matchers to test this association and seeing the following error:

2) Word should have and belong to many entries Failure/Error: it { should have_and_belong_to_many(:entries) } Expected Word to have a has_and_belongs_to_many association called entries (actual association type was has_many)

(same error message for entries --> words)

When we go into rails console we can call 'entry_object.words' and 'word_object.entries' with no problem at all.

Can't figure out why our tests are failing.

jemise111 commented 10 years ago

Associations have changed but problem still happening. Now between user and word models