Having trouble framing this assertion in Rspec for my rails app. A User has a habtm association to Role, I want to assert that, after my test a User should should be associated to a role with a title of “Superuser”. In the rails console.
user.roles.where(title: "Superuser").any?
=> true
How would that look in rspec what I’d like to say is ‘user has a role titled “Superuser”‘
thanks,
How about something like this: