Skip to content

Instantly share code, notes, and snippets.

@johncorderox
Last active April 29, 2021 23:51
Show Gist options
  • Save johncorderox/405ae0e2c34d0482f15714a340e79883 to your computer and use it in GitHub Desktop.
Save johncorderox/405ae0e2c34d0482f15714a340e79883 to your computer and use it in GitHub Desktop.
RSpec with Shoulda Matchers
# Reduce the load of MODEL_NAME.rb with shoulda_matchers
context "Associations" do
%w(users books authors comments topics emails stories tasks reminders notes todos computers games homes pages).each do |attr|
it { should have_many(attr) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment