Skip to content

Instantly share code, notes, and snippets.

@domagude
Last active September 24, 2018 14:47
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/1f47fcd36fb553615fe5b720f003022a to your computer and use it in GitHub Desktop.
Save domagude/1f47fcd36fb553615fe5b720f003022a to your computer and use it in GitHub Desktop.
require 'rails_helper'
RSpec.describe Post, type: :model do
context 'Associations' do
it 'belongs_to user' do
association = described_class.reflect_on_association(:user).macro
expect(association).to eq :belongs_to
end
it 'belongs_to category' do
association = described_class.reflect_on_association(:category).macro
expect(association).to eq :belongs_to
end
end
end
@Al-un
Copy link

Al-un commented Sep 24, 2018

The duplicate on the user association testing (line 11) is corrected here but the duplicate is still here on your repository: https://github.com/domagude/collabfield/blob/master/spec/models/post_spec.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment