You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experiencing errors when trying to add shoulda matcher specs for has_and_belongs_to_many relationships for classes that are not dependent on any gem. At first I thought I had forgotten to configure something, but then I reproduced by writing the same example for similar classes that has long been functioning in a production environment without issue. All this syntax works:
But as soon as I add .join_table(:join_table_name_that_definitely_exists) to the example block in the spec, I get the equivalent of this message:
"Expected #{described_class} to have a has_and_belongs_to_many association " \
"called #{association_name} (join table #{join_table_name} doesn't exist)"
I eventually figured out that the matcher works if you pass the join table name as a string. It appears that the matcher doesn't support table names as a symbol.
I am experiencing errors when trying to add shoulda matcher specs for
has_and_belongs_to_many
relationships for classes that are not dependent on any gem. At first I thought I had forgotten to configure something, but then I reproduced by writing the same example for similar classes that has long been functioning in a production environment without issue. All this syntax works:But as soon as I add
.join_table(:join_table_name_that_definitely_exists)
to the example block in the spec, I get the equivalent of this message:I eventually figured out that the matcher works if you pass the join table name as a string. It appears that the matcher doesn't support table names as a symbol.
Originally posted by @allisonphillips in #625 (comment)
The text was updated successfully, but these errors were encountered: