Skip to content

Instantly share code, notes, and snippets.

@akofink
Created September 11, 2013 13:31
Show Gist options
  • Save akofink/6523653 to your computer and use it in GitHub Desktop.
Save akofink/6523653 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe Comment do
let(:recipe) { mock_model Recipe }
let(:user) { mock_model User }
let(:comment) { Comment.new }
it 'belongs to a recipe' do
Comment.should_receive :recipe_id
comment.recipe
end
it 'belongs to a user' do
Comment.should_recieve :user_id
comment.user
end
end
@akofink
Copy link
Author

akofink commented Sep 11, 2013

@joeyjoejoejr I feel like this should work, but ActiveRecord never calls user_id or recipe_id, which is the actual name of the column which must be referenced to perform the association lookup.

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