Skip to content

Instantly share code, notes, and snippets.

@domagude
Created October 20, 2017 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domagude/5d7798e0ffdda3108cc84aa8f5969ed1 to your computer and use it in GitHub Desktop.
Save domagude/5d7798e0ffdda3108cc84aa8f5969ed1 to your computer and use it in GitHub Desktop.
require 'rails_helper'
RSpec.describe Category, type: :model do
context 'Associations' do
it 'has_many posts' do
association = described_class.reflect_on_association(:posts)
expect(association.macro).to eq :has_many
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment