Rails 4 syntax for has_many helper sockets with order

I have a 4 rail check for my user model:

has_many :items, -> { order(:position) }

I was expecting the following assistant to work:
it {should have_many(:items).order(:position)}

But this causes this error:
Expected User to have a has_many association called items (items should be ordered by position)

Is my syntax wrong for the test?

+4
source share
1 answer

An error occurred in v2.4.0 when this did not work. This has been fixed in version 2.5.0, so check it out!

See here for more details: https://github.com/thoughtbot/shoulda-matchers/issues/388

+3
source