Last active
October 20, 2017 15:10
-
-
Save domagude/ba25865aeded74268d7f3600043405ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rails_helper' | |
RSpec.describe User, 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 | |
expect(association.options[:dependent]).to eq :destroy | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment