require 'spec_helper'

describe Vote do
  describe "New Votes" do
    it "should create new valid votes" do
      user = create(:user)
      idea = create(:idea)
      vote = create(:vote, idea_id: idea.id, user_id: user.id)

      puts user.inspect
      puts idea.inspect
      puts vote.inspect

      expect(vote).to be_valid
    end
  end
end

Create a failing test for Vote model
Create a failing test for Vote model

Votes go against the pattern and don't use the 'id' field as the
primary key by default. Votes require a composite primary key, but
without the 'composite_primary_key' gem and the attributes specified
in the Vote model, testing produced

     'undefined method `to_sym' for nil:NilClass'

errors when trying to validate the test vote records. With the gem
added, test now run into

     TypeError:
       Cannot visit Idea

when executing

     'vote = create(:vote, idea_id: idea.id, user_id: user.id)'
