mongoid-rspec icon indicating copy to clipboard operation
mongoid-rspec copied to clipboard

Naming conflict with shoulda matchers

Open Bartuz opened this issue 10 years ago • 2 comments

have_and_belong_to_many(:association_name) has naming conflict with should amatchers. All other matchers have aliases - which is great! I can use both shoulda matchers and mongoid-rspec matchers.

Here is missing alias: https://github.com/mongoid-rspec/mongoid-rspec/blob/master/lib/matchers/associations.rb#L321-L323

Bartuz avatar Nov 09 '15 13:11 Bartuz

My temporary solution: Mongoid::Matchers::Associations.send(:alias_method, :related_and_belong_to_many, :have_and_belong_to_many)

Bartuz avatar Nov 09 '15 14:11 Bartuz

This is old, but would appreciate a spec/PR with a fix @Bartuz.

dblock avatar Jan 04 '18 19:01 dblock